The JVM Fanboy Blog 

Entries tagged [oracle]

Why the JVM is my favorite platform

by vincent

Posted on Wednesday Nov 18, 2015 at 12:27AM in General

There's currently a lot being written about the somewhat uncertain future of Java. Actually, there's so much being written about this (be sure to click on that last link), that I don't have much to add to this discussion.

Still, I'd like to describe here why the Java platform is my favorite development platform and I will keep on using it on my next projects for the foreseeable future.

Building everything in only one language is a logical, but not necessarily the best choice.

I have changed jobs a few times over the last decade and each one required me to learn a new language.

Having worked with both static and dynamic languages (learning a pure functional language is high on my wish-list) for several years, on different platforms (Windows and Linux mostly), I see advantages and disadvantages for each language and platform choice.

More and more companies permit their development teams to use the tool that the team feel is right for the job. Well known examples of companies that let their team use different languages for different projects are Netflix, LinkedIn, Spotify, Last.FM, etc. I welcome this change and hope more companies will follow eventually.

In my country, The Netherlands, I don't really see this shift happening at the moment, but my guess is it will be the future of development.

JVM: mix and match languages, libraries and even operating systems

The JVM makes it easier (and even fun) to use different languages/operating systems, and still be compatible with many libraries and other development tools.

To me, this is one of the highlights of the platform. Embedding Python script languages in pure Java projects thanks to Jython, using pure Java libraries in the JavaScript language with Nashorn, or writing compact unit-tests code in Groovy for my Java code is a very fun aspect and, in my experience, boosts productivity a lot.

Personally, I develop many of my projects on a Windows machine and deploy the very same JAR file, containing all dependencies that I have tested on my machine, on a Linux server. Here Java developers have more freedom as well than users of most other languages.

Another advantage of having multiple languages is this: I'm sure many new Java 8 features were inspired by the dynamic JVM Groovy language. Having more languages from different vendors/teams on one platform is a very positive thing, it keeps everyone awake.

Modern feature-set

Other highlights:

  • Java is focused on performance. Being able to run threads on different CPU cores is very important to me. We have multi-core CPUs for a very good reason.
  • Thanks to Java 8's Streams API, it's never been easier to make use of multiple cores with minimal code changes. It must be mentioned Java 7 added great multi-threading features as well.
  • JVM developers have so much choice: application servers, databases (even natively written in Java), enterprise application frameworks, mature web frameworks, ORM, etc.
  • Very good development tools. Again a lot of choice, like NetBeans, IntelliJ, Eclipse, JDeveloper IDEs.
  • Memory consumption and boot time can still be a problem, but Java 9 is expected to improve this as part of their modularity Jigsaw project

Do something back...

I think there's something that we Java developers can do to try to keep the Java community healthier. If your company is making money and running on many different open-source projects, consider donating back to at least one of those projects (create patches to fix bugs, improve documentation....). In the very least blog actively about your usage of those projects.

If your company can afford it, instead of automatically using the open-source GlassFish enterprise application server, consider reviewing the commercial Oracle WebLogic server. Oracle is a commercial company and probably wouldn't mind making money on its Java products.

It's probably wishful thinking on my part, I know it's much easier said than done.

Do not forget that the JVM is also not the right tool for everything

While my blog is called JVM Fanboy, I have a lot of interests in other programming languages as well. As a developer you should never put all eggs in one basket.

Node.JS for example is simply incredible. Also I work with Python daily and enjoy that a lot as well. Those languages get more than enough press time, so that's why I decided to blog about JVM-related stuff exclusively. But that does not mean that those other popular languages don't deserve their popularity.

Oracle Nashorn + Oracle NoSQL: First steps

by vincent

Posted on Tuesday Oct 20, 2015 at 11:12PM in NoSQL Database

Learning to work with Oracle NoSQL was a high entry on my to-do list. I always figured Oracle Nashorn (the new JavaScript engine that runs on JVM and is shipped for the first time with Java 8) is an ideal language to learn and try JVM-based APIs, mainly because of the interactivity of the JavaScript language. So, I thought this would be a cool opportunity to test the Oracle NoSQL API with Nashorn.

I was absolutely not disappointed. Nashorn is, in my opinion, an excellent tool for learning new APIs

About Oracle Nashorn

First of all, I am a huge Nashorn fan. Although not as fast as Node.js (which is powered by Google's mighty V8 engine), bringing the flexibility of a modern JavaScript implementation to the JVM world was a very good idea. I love that it is part of Java 8 SE, so every Java developer that uses Oracle-based JREs or JDKs has full access to it.

The Nashorn team added extensions to the JavaScript language so that JavaScript code can make full use of existing JVM classes. Also, Nashorn is compatible with the existing JSR-223 "Scripting for Java Platform" standard, which means that the Nashorn engine can be embedded into any JVM program. Using this technique, you can embed JavaScript code in your Java 8 (and up) projects, that communicate with your objects while Nashorn executes the JavaScript code dynamically. Mind blowing IMO... :-)

Read the full article for much more background information and sample code

Read More