Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Java 8 Has Landed – A MuleSoft Perspective

DZone's Guide to

Java 8 Has Landed – A MuleSoft Perspective

· Integration Zone
Free Resource

Share, secure, distribute, control, and monetize your APIs with the platform built with performance, time-to-value, and growth in mind. Free 90 day trial 3Scale by Red Hat

[This article originally written by James Donelan.] 

It’s been a long time coming, but we’re glad it’s here. Oracle just announced the arrival of Java 8 – a long-anticipated update which includes the addition of lambda expressions and support for functional programming. Here’s a look at some of the new features and why they are important to engineering at MuleSoft.

Functional Support

Lambda expressions bring functional programming to the Java language. Lambdas enable you to treat functionality as a method argument, or code as data and express instances of single-method interfaces more compactly. We experiment in different languages here all the time and functional programming has made a big comeback in the past few years with more developers moving to JavaScript, Scala and Clojure due to their expressiveness and ease of use. It’s great to see Lamba support in Java and acknowledgement that sometimes there are simpler ways to do things.

JavaScript Support

We decided last year to start doing some of our cloud platform development using JavaScript on Node. So far we’ve been using Google V8 as our runtime but Java 8 now provides an alternative, namely Nashorn. If it is successful then we could see a lot more developers and operations teams using the JVM for running JavaScript on the server side for the same stability and ease-of-use reasons that the java virtual machine is popular for running JRuby and other languages. It could really open up Java and the JVM to a brand new class of developers. We’re looking forward to trying it out and ideally reusing much of our existing Java-based infrastructure for running JavaScript applications server-side.

Java on Tiny Devices

Java SE is an impressive platform, but with all that functionality comes a large footprint.  A new feature called subsetting or striping allows you to deploy only those components required for a particular application instead of the entire Java SE runtime environment. Ideal for tony devices that require small footprints. With Android already topping 80 percent of the smartphone market and 50 billion connected devices expect to be on the planet by 2020, that seems like a really smart thing for even greater adoption. Our Anypoint Plaform for APIs will provide the connectivity and back-bone for much of this device connectivity so it’s an important improvement for us.

Streams

Developers should find some of the new Streams APIs with it’s functional-style operations such as parallel map/reduce great for bulk data operations and faster data processing. It fits well with our recent new features for supporting batch processing and improved data processing which you can read about here.

Improved APIs

As always Java 8 brings lots of security fixes, unicode updates, concurrency improvements and a lot more.

The Missing Stuff

Some new proposed features like Jigsaw were dropped from the release. It’s a pity since modularity and interoperability are still a big problem in Java. We leverage a lot of 3rd party open source libraries and have felt the pain when dealing with multiple class loaders and managing runtime dependencies. 

Looking Forward

MuleSoft has Java and Open Source at our roots and we continue to invest heavily in Java. We’re looking forward to working with Java 8.

Discover how you can achielve enterpriese agility with microservices and API management

Topics:

Published at DZone with permission of Ross Mason, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}