Spring versus Java EE


In the beginning Spring was not that ambitious, then it came to the point on IoC and Dependency Injection when the Spring Dev team though that they could get a full suite of products on their own and they decided to try to build a replacement of several Java EE related products.

Check this piece of Spring 3 documentation:

The recommended integration style is to code DAOs against plain Hibernate, JPA, and JDO APIs. The older style of using Spring’s DAO templates is no longer recommended; however, coverage of this style can be found in the Section 38.1, “Classic ORM usage” in the appendices.

Basically what Spring is saying here is “we fucked up, trying to be too invasive in something we were not handling directly”, there are some articles on how this trend evolved in Spring 1, 2 and then rolled back in v3, follow the link So should you still use Spring’s HibernateTemplate and/or JpaTemplate?? while it lasts for more:

The fact that these technologies (ORM engines) are using runtime exceptions essentially renders the Spring template equivalent for those technologies useless… at least largely, and if you’re looking at it from a code simplification standpoint.

Furthermore if you look at frequency of use, most of the time Spring is relying on well established services provided either by open source libraries or Java EE servers.

Just an example: there are tons of people using Spring to lookup resources in JNDI through beans… well, that is funny, Spring was supposed to be sold as the “containerless solution”, then they tried with the “lightweight container solution” concept. But the point is people is deploying Spring as just another library in already bloated Java EE apps… dude, that is the definition of the word “not being up to the hype”!

Spring DM for example typically came with Tomcat, even with the server.xml file… trying to get the “containerless” thing to work was true only for the “Hello World” and little more.

Of course while this happened some companies like Oracle saw what the Spring company/ONG/interest group/lobby was doing and decided to say that Spring is no friend to their Weblogic and that developers should migrate from Spring to Java EE 6 servers (yea, Weblogic). Java Spotlight Episode 85: Migrating from Spring to JavaEE 6.

And also pretty obviously Spring started putting the foundation for their suite of “dumbification suite” (i.e. the cloud), the summary of all this would be:

2002: Spring is humble, use me!
2006: We will do it all!
2007: Doh!, we were trying to do too much
2008: Let’s help integrate with everything, the Spring brand will be more important than the real centralization of elements and configurations in simple ways!.
2013: Uou!… how much complexity we built, we are almost killing O.O.P. Let’s dumbify cohesive configuration of solutions with Spring boot
2014: Lets put buttons in the cloud to deploy those cohesive configurations and make money.

The TL:DR is “If someone tells you that configuring and maintaining a huge solution with Spring is easier than with the average Java EE environment, you can tell that person to kiss my beans”.