About Anton Arhipov

Anton is JRebel Product Lead at ZeroTurnaround. Professional interests include programming laguages, middleware and tooling. Java enthusiast, vim fan, IntelliJ addict and JetBrains Academy member. He blogs at "Code Impossible" blog and speaks at Java conferences.

Java EE 7 Public Draft was published. I demand Java EE Light Profile!

On December 20, 2012 a public draft of Java EE 7 has been uploaded. From the first sight, the new spec is rather an improvement of the subsequent specs in Java EE 6. For instance, I really like the Web Profile idea. But is is a shame that it wasn’t a part of Java EE 6 Web Profile.

The Web Profile is targeted at developers of modern web applications IMO, most of the modern web applications make use of REST. Or at least this is my perception. In Rails world, AFAIK, violating REST principle is a subject for brutal prosecution by the colleagues. Luckily Java EE 7 fixes that mistake and JAX-RS specification is now a part of Web Profile.

Targeting “modern” web applications then implies offering a reasonably complete stack, composed of standard APIs, and capable out-of-the-box of addressing the needs of a large class of web applications.

OK, now you can really develop ‘modern’ web apps with Web Profile, but…

In terms of completeness, the Web Profile offers a complete stack, with technologies addressing presentation and state management. (JavaServer Faces, JavaServer Pages), core web container funtionality (Servlet), business logic (Enterprise JavaBeans Lite), transactions (Java Transaction API), persistence (Java Persistence API) and more.

Sounds like redundancy to me. For instance, why would you need EJBs there? If CDI supported interceptors properly there wouldn’t be a need for EJBs in that sense. Or, JSF? Well, I’m just not a fan of that.

What I’m trying to say here is that since for compatibility reasons there wouldn’t be possible to drop specs from Web Profile, maybe it is now time to create a ‘Light Profile’? A minimalistic set of Java EE specs that would be sufficient for building modern web applications.

Of course the term is a bit foggy – what should we consider a modern web application. These days it is a combination of a REST backend and UI technologies such as HTML5 and JavaScript. My logic says that since Java EE doesn’t specify UI technology then the main specification that required is JAX-RS and the complementary specifications to support transactions (JTA/JTS), persistance (JPA), and dependency injection (CDI). Of course, there are some nice complementary specifications such as Bean Validation and Java API for JSON processing. But I would definitely drop JSF and EJBs for sure.

This would bring the containers like Tomcat and Jetty even closer to the spec and who knows maybe one day we will have a Java EE ‘Jetty Profile’, why not
 

Reference: Java EE 7 Public Draft was published. I demand Java EE Light Profile! from our JCG partner Anton Arhipov at the Code Impossible blog.

Related Whitepaper:

Functional Programming in Java: Harnessing the Power of Java 8 Lambda Expressions

Get ready to program in a whole new way!

Functional Programming in Java will help you quickly get on top of the new, essential Java 8 language features and the functional style that will change and improve your code. This short, targeted book will help you make the paradigm shift from the old imperative way to a less error-prone, more elegant, and concise coding style that’s also a breeze to parallelize. You’ll explore the syntax and semantics of lambda expressions, method and constructor references, and functional interfaces. You’ll design and write applications better using the new standards in Java 8 and the JDK.

Get it Now!  

2 Responses to "Java EE 7 Public Draft was published. I demand Java EE Light Profile!"

  1. Tadas Šubonis says:

    The main point of EJB (now) is to have transaction handling across multiple resources and endpoints (DB, Messaging other stuff). I doubt you would achieve that easily with CDI. If you are going to code your one interceptors that would provide transactions and their scoping, you would be almost reimplementing EJB. Just including it is way easier.

    • arhan says:

      Yes, EJBs bring some goodness also. However, iIf CDI could support interceptors, then you could achieve the transactional behavior just with CDI beans with no support from EJBs.

Leave a Reply


eight × 4 =



Java Code Geeks and all content copyright © 2010-2014, Exelixis Media Ltd | Terms of Use
All trademarks and registered trademarks appearing on Java Code Geeks are the property of their respective owners.
Java is a trademark or registered trademark of Oracle Corporation in the United States and other countries.
Java Code Geeks is not connected to Oracle Corporation and is not sponsored by Oracle Corporation.

Sign up for our Newsletter

15,153 insiders are already enjoying weekly updates and complimentary whitepapers! Join them now to gain exclusive access to the latest news in the Java world, as well as insights about Android, Scala, Groovy and other related technologies.

As an extra bonus, by joining you will get our brand new e-books, published by Java Code Geeks and their JCG partners for your reading pleasure! Enter your info and stay on top of things,

  • Fresh trends
  • Cases and examples
  • Research and insights
  • Two complimentary e-books
Get tutored by the Geeks! JCG Academy is a fact... Join Now
Hello. Add your message here.