About Siva Reddy

Katamreddy Siva Prasad is a Senior Software Engineer working in E-Commerce domain. His areas of interest include Object Oriented Design, SOLID Design principles, RESTful WebServices and OpenSource softwares including Spring, MyBatis and Jenkins.

What additional features does Java EE 6 have to move from Spring?

I am a senior java developer who has to work on the technologies chosen by the application architect. At the maximum I can express my opinion on a particular technology, I can’t make/influence technology selection decision. So I don’t have a choice of moving from Spring to JavaEE6 or from JavaEE6 to Spring on my official projects.

I strongly believe that as a Java developer I have to keep updated on (at least few) latest technologies. So I(many java developers) generally follow java community websites or blogs to have an idea on whats going on in java community. Specifically I do follow updates from some Java Champions or well known popular authors because they might have better vision on what is next big thing in Java space.

Few years back I have seen so many people talking about Spring. Then I started learning Spring and still I just love it. I have been using JavaEE5 for a couple of years and I didn’t find any feature which Spring is not providing. But recently I am seeing so many articles on “Moving from Spring to JavaEE6″ for every couple of days. So I thought of giving it a try, I installed NetBeans7.1, Glassfish3.1 and did a simple POC. Its wonderful, I am able to write a simple app in just 10 min.
Yes, JavaEE6 improved a lot over it predecessors.

But again I am not seeing anything new which I can’t do with Spring. 
OK, let me share my thoughts on the criteria that is chosen by “Moving from Spring to JavaEE6″ article authors.

1. So many Jars in WEB-INF/lib

Spring application has its dependencies in WEB-INF/lib and JavaEE6 app will have in server lib. Even for Spring app, we don’t need to go and manually download all those Jars, we can use Maven/Ivy or even we can start with an archetype template with all dependencies configured. And its only onetime Job. I am not sure will there be any performance improvement by having jars in server lib instead of WEB-INF/lib. If that is the case we can place Spring app dependencies in server lib.

What I am missing here?

2. Type-safe Dependency Injection

From Spring 2.5 we have annotation based DI support using @Autowired and if you are still saying Spring is XML based please take a look at Spring 3.x. If you want to give a custom-name to spring bean(in case of multiple implementation for same Interface), you can. How is it different from JavaEE6’s CDI @Injext and @Named?

3. Convention Over Configuration

EJB3 methods are transactional by default, just slap it with @Stateless. In Spring we can create a custom StereoType, say @TransactionalServe, like @Service @Transactional public @interface TransactionalServe { } and we can achieve Convention Over Configuration.

Did I miss anything here?

4. Spring depends on JavaEE

Of course Spring depends on JavaSE and JavaEE. Spring is just making the development easier. You can always use JavaEE APIs like JSF, JPA, JavaMail etc with Spring in easier way. Did anybody said Spring came to completely vanish JavaEE?? No.

5. Standards based, App Server Support, License blah blah blah.

These are the things that developers don’t have much(any) control. From a developer perspective, we love whatever makes development easier. So I am not seeing any valid reason to migrate an existing Spring app to JavaEE6. Till now I didn’t find one thing which CDI can do and Spring can’t do. For green field projects just to have depency injection we might not need Spring as we already have CDI in-built in JavaEE6. Does JavaEE6 address any of the following:

1. Batch Processing: Almost all the big enterprises have some batch jobs to run. Does JavaEE6 have any support for implementing them. Do you suggest to use Spring Batch or start from scratch in vanilla JavaEE6.
2. Social Network Integration: These days it became very common requirement for web apps to integrate with Social Network sites. Again what do you have in JavaEE6 for this?
3. Environment Profiles: In Spring I can have my mock services enabled in Testing profile and my real services in Production profile. I am aware of @Alternative, but can we configure more than 2 Alternatives without using String based injection?
4. Web application Security: What is Spring-security’s counter part in JavaEE6?
5. What about integration with NoSQL, Flex, Mobile development etc?

JavaEE6 got CDI now, so suddenly Spring become legacy!!!!

Conclusion: Yeah JavaEE6 has cool stuff now(lately??) but it is not going to replace Spring anyway. Long live Spring.

Reference: What additional features do JavaEE6 have to move from Spring? from our JCG partner Siva Reddy at the My Experiments on Technology blog.

Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

JPA Mini Book

Learn how to leverage the power of JPA in order to create robust and flexible Java applications. With this Mini Book, you will get introduced to JPA and smoothly transition to more advanced concepts.

JVM Troubleshooting Guide

The Java virtual machine is really the foundation of any Java EE platform. Learn how to master it with this advanced guide!

Given email address is already subscribed, thank you!
Oops. Something went wrong. Please try again later.
Please provide a valid email address.
Thank you, your sign-up request was successful! Please check your e-mail inbox.
Please complete the CAPTCHA.
Please fill in the required fields.

One Response to "What additional features does Java EE 6 have to move from Spring?"

  1. mauricio says:

    You forgot one of the most important point. JEE is a standar.

Leave a Reply


8 × = seventy two



Java Code Geeks and all content copyright © 2010-2014, Exelixis Media Ltd | Terms of Use | Privacy Policy | Contact
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.
Do you want to know how to develop your skillset and become a ...
Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

Get ready to Rock!
You can download the complementary eBooks using the links below:
Close