Updated: 5/31/2004; 9:49:06 AM.
Java and Object Orientation
Discusses tools, principles, and patterns relating to Java and Object Orientation.
        

Sunday, May 30, 2004

I've encountered several milestones in the past five years that have changed the way I work. The first and most important milestone was becoming test-infected via junits.

The second milesone was finding jboss, which made using EJBs moderately tolerable and affordable. I was ready to abandon EJBs (maybe that still would not have been a bad decision). EJBs have always been an exercise in configuration minutia: endless fat books on J2ee, deployment descriptors, application.xml, ejb-jar.xml, ejb refs, et cetera ad nauseum. It does not feel like the simplest thing that could possibly work.

I think I have now stumbled across another milestone: the Spring Framework. This will definitely change and simplify the way I build applications. It is a framework designed to make j2ee easier--in many cases eliminating the need for EJBs altogether. I've only start scratching the surface but I already learned how to greatly simplify jdbc coding by using the org.springframework.jdbc.object package and by using declarative transaction management provided by Spring's AOP capabilities.

Several speakers at the recent Rocky Mountain Software Symposium stated that EJB 3.0 is being heavily influenced by the ideas in Spring (and other inversion of control containers) as well as Hibernate. EJB 3.0 will use annotated POJOs and POJIs (plain old Java interfaces).

One of the motivations for Spring is to improve testability of j2ee applications. Perhaps, stated another way, test-driven development--which can mutate design when done correctly--is exposing the current design of EJB for the mess that it is. Here is why Spring apps are more testable: 1) POJOs are easily testable outside of the j2ee container. 2) Spring encourages the use POJOs and POJIs. 3) Spring knows about your POJOs but they don't know about Spring. 4) Dependency injection provided by Spring makes it easy to mock or stub major portions of your code.

I just heard of Spring a few weeks ago. How did I miss this? I had trouble understanding what it was for at first. I wanted to like it, but I didn't know why. :>  A few case studies or usage scenarios on the Spring website would help.

Just got back from the Tattered Cover in Cherry Creek. I found Rod Johnson's book Expert One-on-One J2EE Design and Development which introduced the concepts and sample code that became Spring. Yes, it's another fat book on j2ee but this one is very different.


9:51:13 PM    

© Copyright 2004 Larry Sherrill.
 
May 2004
Sun Mon Tue Wed Thu Fri Sat
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Mar   Jun


Click here to visit the Radio UserLand website.

Subscribe to "Java and Object Orientation" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.