aspose file tools
The moose likes Spring and the fly likes Spring comparison Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Application Frameworks » Spring
Reply Bookmark "Spring comparison" Watch "Spring comparison" New topic
Author

Spring comparison

Nico Van Brandt
Ranch Hand

Joined: Mar 31, 2011
Posts: 66

We are always comparing technologies as professional IT-ers.

Which of the two is the most performant, the most lightweight, the best option for small/large-scale applications...

How do the authors feel about the constant comparison of EJB3 vs Spring?

Can the two be really compared and is there an obvious line of telling 'For this project it's obvious you use Spring/EJB' or is it more about which product do I like the most?

Regards


Oracle Java SE6 Certified Programmer
Oracle Java EE5 Certified Web Component Developer
Josh Long
author
Greenhorn

Joined: Apr 04, 2011
Posts: 24

Well, as always with these sorts of open-ended comparisons, it's helpful to try to be specific. EJB3 (and EJB 3.1) provides a component model for services that manipulate state (most of the time using JPA (and JPA2). The component model assumes that you might need to expose your EJBs for remote clients using SOAP or RMI, and it assumes that you might need to have declarative transactions. It assumes you might want to handle JMS messages in a bean, too. It assumes that you are content working in an application server, which doesn't promote unit testing or portable code. That's (broadly speaking) about it.

If you simply want service objects that are able to manipulate JPA state and provide declarative transactions and be exposed as web services, than Spring provides all of that *and* you can unit test it naturally and you enjoy full support for deploying to other environments like clouds and web servers, not just Java EE application servers.

However, Spring is a much, much, much larger superset than EJB. "Spring" also provides batch processing, web frameworks, much stronger RDBMS support - JPA1, JPA2, JDBC, JDO, etc, mobile client support, big data (Neo4j, CouchDB, Riak, Redis, MongoDb, etc.), Hadoop support, and numerous simplifying APIs for other APIs that EJB has no particular support for, including JDBC, iBatis, etc. Technically there is no reason to use EJB3 or EJB3.1, there is nothing that it can do that Spring can't and a whole world of things that Spring can do that EJB (and Java EE6) can't.


Thanks, Josh Long
Spring Developer Advocate, SpringSource, a division of VMware
http://blog.springsource.org - http://www.joshlong.com
Dariusz Skrudlik
Greenhorn

Joined: Apr 14, 2011
Posts: 6
I agree that we are able to do almost anything with Spring (and more).
But what about scalability and performance ?
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 16624

Dariusz Skrudlik wrote:I agree that we are able to do almost anything with Spring (and more).
But what about scalability and performance ?


Since your code and application is now POJO, then is Java scalable or performant. It really now comes down to that and not to do with Spring itself. Spring is out there in very large applications, so it is scalable and performant.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
 
subject: Spring comparison
 
Threads others viewed
Spring and JBoss Seam
Deep and Shallow Comparison!!
Spring in Action by Craig Walls, Ryan Breidenbach
Comparing Google Guice and Spring Ioc Containers
setting up log4j in an applicationcontext
developer file tools