Skip to main content

Java Enterprise Development - 2010 style

Posted by jjviana on March 1, 2010 at 7:45 AM PST

I woke up the other day and realized its 2010. When I was a kid, year 2000 was far, far away (well not quite, but hey when you are 7 years old 13 years is a long time).

In 2001 we were supposed to be colonyzing the moon.  In 2010, Jupiter would be within our reach.  And there are reliable reports indicating that  9 years from now flying cars and aritificial life forms should be common place. I must admit: the kid within me feels kind of disappointed.

On the other hand, I´ve recently started a couple of brand new enterprise applications in Java, from scratch. How does it feel like starting  a J2EE 6 aplication in 2010? Lets take a look from the point of view of a developer who just got started in the technology:

  • You use the Java EE 6 Web Profile, and don´t need to pack your application into an EAR file.
  • You code your domain model using a xml-less ORM fram framework (JPA). JPA actually makes sense and does what its supposed todo without fuss.
  • You let your JPA implementation generate your database schema for you, which it does with surprising efficiency.
  • You use modern, component-based  view frameworks (like Facelets or Wicket) , and get by writing little or no XML for defining navigation (remember struts-config.xml?)
  • You use annotations everywhere (your JPA entities, your Session Beans, your Servlets) and even start to forget XML syntax
  • You don´t bother writing deployment descriptors for all your session beans.  You just add one annotation to any POJO and it automatically gains EJB powers.
  • You only write Remote Interfaces when you actually needs a component to be remotely accessible.
  • You have no idea what CORBA is.
  • You have a vague idea of what JNDI is, but  you use dependency injection everywhere to get what you need.
  • You develop using a lightweight application server (glassfish 3) that redeploys your application in seconds every time you make a change. Most of the time you don't even notice it.

If this list doesn't feel like sci-fi to you, congratulations! You are one of the lucky ones that missed all the fun of PortableRemoteObject.narrow(...) , 5 min redeployment times and bean-managed persistence.

Looking back it seems like it took an awfully long time for the platform to get there. And it did. I think we ought to give a big thank you to the guys at Hibernate, Spring and countless others for pushing the platform forward by  pioneering most of the good features in Java EE 6.

 

 

 

Comments

Annotations everywhere

When I look at some examples, I really don't think that we have won that much by having annotations. I already had the (dis-)pleasure to look at code where more lines are spent with annotations, than real code, making very hard to understand what is going on.

Annotations can be misused,

Annotations can be misused, like every other language feature. But I believe having the meta data closer to the code is much better in some situations (like JPA).

On the other hand, I have seen people put things in annotations (like server addresses) that really belong to a configuration file.

COBRA

You say you don't remember COBRA?!

lol! I would rather not have

lol! I would rather not have remembered, thanks for the tip.

Annotations are so 2005

Annotations are so 2005 man. You should check what Spring is doing _today_ with Grails and Roo,using heavy convention over configuration and sensible defaults. JEE6 is here and it still has a lot to chatch up.

I've checked out grails and

I've checked out grails and roo, they seem to be very nice frameworks. However, I couldn't get grails to use Wicket as a view technology, and in the end I couldn't find a lot of advantages of grails vs. Java EE 6.

Java EE will always be playing catch up with the latest technologies...