Some things that happen in the name of architecture do not exactly pan out as planned. Enterprise Java Beans is...
one of them. Although many individuals and corporations had a role in establishing this component standard within the larger J2EE standard, EJB is seen in some circles as IBM's major contribution to Java. Sometimes EJB is described as bloated; sometimes, worse.
The thinking behind EJB somewhat predates Java, as it followed on the heels of IBM's code-name San Francisco component effort. EJB, especially as it has evolved, is widely seen as too complex. That may be because it has tried to be fully encompassing.
Narrower, focused frameworks have arisen as alternatives to full-fledged J2EE with EJB. Chief among these is the Spring Framework, which uses Aspect-Oriented Programming techniques to identify overarching design patterns while focusing on the day's most common job, Web-enabling applications.
Preliminary data from a 2008 Java Trends survey by SearchSOA.com sister site TSS.com shows that 76.8% of survey participants have used Spring. Acting as something of a commercial Spring steward is SpringSource, a company dedicated to promoting Spring-style app building. We spoke recently with company founder and president Rod Johnson. He told us Spring and SOA are very complementary.
The portability is key to the drive to Java is not a done deal if services are tied to servers.
"SOA is about integration of different things," said Johnson. "This is where we think Spring is beneficial."
"The models in traditional methods of J2EE with EJBs tended to tie your code very much to a particular environment: the monolithic application server environment. While Spring can be happy [in a monolithic server environment], the Spring container is also inherently portable," he continued.
Able use of Spring can better ensure, 'separation of concerns.' That is one the goals of Spring, and is epitomized by its use of a Model View Controller (MVC).
With Spring, "you may have greater freedom to repurpose your business logic, and to deploy in non-traditional deployment scenarios," said Johnson.
While many successful applications have been built using EJB, it has never become exactly popular. On the face of it, there is something of a 'let's do it' attitude to lightweight frameworks. That does not mean that such approaches cannot co-exist within larger corporate SOA programs – but it doesn't mean they support SOA, either.
Have you any thoughts on the interplay or lack there of between SOA and lightweight frameworks? Let us know.