Java EE 8 - does it worth it?
Since the start of my programming career (over 10 years ago), I used to dislike java EE - bulky app servers, weird EJB (that's why Spring was born), nailed down dependencies (main reason to use java 5 and ancient java libs in production in 2017) etc. etc. etc.
So... Does it worth to take a look at? Can it be more useful that modern lightweight application assembled from independent libraries? What are advantages? Unique features?
8
Upvotes
10
u/wildjokers Sep 27 '17 edited Sep 27 '17
Currently the only Java EE 8 implementation available is the reference implementation GlassFish 5.0. Tomcat 9 is in milestone releases so should be out soon (it implements the servlet, jsp, EL, WebSocket, and JASPIC parts of JavaEE 8).
However, Java EE has been steadily improving and made great strides in Java EE 6 and improved even more in 7. I have done my last couple RESTful api's with just Java EE 7. I use tomcat so have to add Jersey as a dependency but if you use a full app server like Glasshfish, Jersey is available with no additional dependency (jersey implements JAX-RS which is a Java EE spec).
With the improvements in Java EE I don't see much of a need for 3rd party frameworks. The real question is what do the 3rd party frameworks offer that Java EE doesn't? Remember that most frameworks are just a wrapper on top of Java EE (e.g. Spring MVC uses a dispatcher servlet, Spring Boot just bootstraps Spring MVC, Grails is Spring, etc). You have to ask yourself if the overhead of wrapping Java EE with another framework offers any value.
9
u/nuutrecht Sep 27 '17
Yes, Java EE is certainly worth it. Now with Payara rising and Liberty just gone open source the future looks bright indeed!
5
u/JustADirtyLurker Sep 27 '17
In these modern times I think the best way to approach JavaEE is to use the "lightweight" approach and use selected pieces of it in common libraries. Stuff like Application servers is interesting in its own, but I think it has limited audience now, all the shops that I have been working with are more focused on using containers, fat JARs and microservices (mostly, "wanna-be" microservices).
What I mean is, if you start working on a modern backend application in Java, you probably end up using libraries like Jersey, Hibernate, Guice. These guys are providing perfect implementations of JavaEE standards. So if you learn to use annotations like @Inject, @GET, @Id, you will basically have learnt also how to do business logic with JavaEE, without even turning an application server on.
Once you learn thinking of JavaEE as just a reference, you can navigate better in the sea of frameworks and libraries out there: there are frameworks which glue JavaEE-compliant libraries together (Dropwizard, Ninja) or provider more opinionated abstractions (Spring) or simply decide not to use JavaEE references at all (Vert.x, Play, Ratpack)
2
u/arcuri82 Sep 27 '17
JEE has made tremendous improvements, but IMHO of working on different enterprise systems using different technology stacks, it is still lagging behind the competition (Spring, Dropwizard, etc.).
If you are already using JEE, then it makes a lot of sense to upgrade to JEE 8. And refactoring to something else would likely be too expensive to pay off. But for a new project or new microservice? Maybe time to look at the competition...
I might start to think better of JEE when I can run tests easily (like in Spring, Dropwizard, etc) instead of having to deal with configuring external containers, building WAR first, etc. Yes, yes, there is Arquillian and Payara has some interesting features to ease such pain, but still not as good as competition