POJO Application Frameworks: Spring Vs. EJB 3.0
Subject:   A bit on the diagonal ...
Date:   2005-06-30 12:57:02
From:   BillSiggelkow
My gut feel is that this article is somewhat slanted. It paints Spring as a framework that is relatively closed and complex. Struts is proprietary and has managed to enjoy a modicum of success. Likewise, in my opinion this article downplays several strengths of Spring that, from a purely pragmatic standpoint, are quite important:

  • Spring is available now as a mature framework that can run without an application server, if desired.
  • Spring will run just fine on JDK 1.4.2. While I'd love to be developing with 1.5, I would bet that most corporate IT shops are not ready to make the jump.
    <lil>Spring's object factory (bean wiring) is not complex; it is robust. Any reasonably intelligent developer can understand the basics of DI just by looking at the file. After all, how hard is it to interpret this:<br/>
    <property name="greeting" value="Hello World"/>
  • Spring's DI capability is general-purpose and broad; from your article it seems that the EJB 3.0 capability is limited to managed objects.
  • Spring makes testing easier. It is laffable that you describe in-container testing as "easier".
  • Spring offers choice; this is an advantage that should not be discounted.
I believe that the Java community would be better served by a discussion that focuses on the appropriateness of different frameworks. EJB 3.0 and Spring, are without a doubt both excellent frameworks for J2EE. Developers and architects want to know how well these different frameworks meet their needs. The answers to those questions are the ones that will really help.
Full Threads Newest First

Showing messages 1 through 1 of 1.

  • A bit on the diagonal ...
    2005-06-30 21:53:49  MichaelYuan [View]

    Sorry if you feel that the article is biased against Spring. But actually, I did discuss Spring's advantage over EJB 3.0. For instance, it is more flexible, has generic DI and the XML config format does have advantages in some situations ...

    Furthermore, I believe EJB 3.0 is greatly indebted to open source frameworks like Spring and Hibernate -- they pioneered the key concepts in EJB 3.0.

    However, I also believe that EJB 3.0 learned the lessons from Spring and Hibernate so well that, in most cases, EJB 3.0 addresses what most developers need with a standard API. I guess that is cause of the perception that the article is "biased". But believe me, I did not intend to talk down upon Spring.

    As for "in container testing", I do believe it is better than mocking -- if the container is lightweight and small. But obviously, this is subject to debate. :)