Spring Framework
I went to the Twin Cities Java Users Group meeting on The Spring Framework. It was inspiring because people were really enthusiastic about Spring and the speaker, Adam Waldal, was quite good.
Here are some notes:
- He has seen huge (3 year) projects decide on Spring as their framework.
- The big thing about Spring is that it is what is known as an Inversion of Control Container (IoC). As an IoC, Spring uses reflection to pull off either setter injection or constructor injection. Both of these are ways to completely decouple an object’s implementation from objects that it might spawn, with the new method, for instance. The upshot is that your business objects will not get infected with Spring code. Spring is hanging out nearby, listening for when it is needed. As one article puts it,
The concept behind Inversion of Control is often expressed in the Hollywood Principle: “Don’t call me, I’ll call you.” IoC moves the responsibility for making things happen into the framework, and away from application code. Where configuration is concerned this means that while in traditional container architectures such as EJB, a component might call the container to say “where’s object X, which I need to do my work”, with IoC the container figures out that the component needs an X object, and provides it to it at runtime. The container does this figuring out based on method signatures (such as JavaBean properties) and, possibly, configuration data such as XML.
- “Its not just for web applications anymore.” A lot of Swing developers are using spring
- Spring differs from struts in that it codes around interfaces while struts extends concrete classes.
- The reflection capabilities built into Spring allow unit testing to go much faster. Cactus - test everything would take long enough for his development team to go take a coffee break. With Spring, the same task takes less that one minute.
- It is his belief that unit testing should be happening without the business objects having any knowledge of the container they are in (as in EJB) and should not need the container to run a test and Spring allows this.
- Spring makes heavy use of patterns (which is good)
- Spring works well with hibernate
- EJB vs Spring. EJB sees a “Big chunk of code” it might reuse and ignores the fine grained reusable bits of code while Spring lets you drill down as close as you want in defining reusable bits of code.
- Spring can be used with Aspect Oriented Programming (AOP) also known as byte code emitters
- One guy in the audience gushed about how easy Spring was.
- Eclipse has a Spring plug-in.
- Spring can wrap itself around a struts implementation, but struts cannot wrap itself around another framework.
- JMS was brought up a lot. I didn’t know what it was, so I looked it up. It is Java Messaging Service. A way for distributed clients to talk to one another.
January 20th, 2005 at 7:12 am
Hey Tim, Check out http://www.ofbiz.org for another Java framework. Its years ahead of struts and spring and it works :-)
Steve
January 20th, 2005 at 9:00 am
Sorry I missed this meeting; I’ve really got to start attending. I’m glad to hear local excitement about Spring. We tried to move toward using Spring at work but the idea was nixed by a consultant and by overcautious management (who are still unsure about Java, for cryin’ out loud, because it doesn’t have the track record that Cobol does. I’m also unsure about Java’s appropriateness to our task, but for entirely different reasons). I maintain that we’ll be back using Spring in a couple years, when the framework has achieved enough street cred that CIOs read about it in magazines — and once we tire of banging our head against everything in J2EE that makes easy things hard. And once I manage to get everyone test-infected. :)
January 20th, 2005 at 9:02 am
I forgot to add: and once my Java is solid enough that I can make cogent technical arguments for using Spring. At this point, it feels right, I know in my gut that Spring and its kin are on the right track by simplifying Java development, but I don’t feel that I’m ready to argue that point convincingly.
January 20th, 2005 at 4:02 pm
TIm,
do you use Eclipse?
andy
January 20th, 2005 at 4:17 pm
I use Eclipse for PHP editing sometimes, but use IntelliJ IDEA here at work
January 20th, 2005 at 6:32 pm
Our guys use eclipse, priror to that we used Together. Eclipse rocks! And the price is right :-)
January 21st, 2005 at 8:23 am
I too am in favor of Spring, but I think you guys are talking about something different than a season.
January 21st, 2005 at 1:59 pm
Katy, if what I heard there was true Spring the framework promises to be as refreshing and life bringing as spring the season. Steve, I will add ofbiz to the ever growing stack of promising technologies I hear about.
July 25th, 2005 at 2:10 pm
The comment made by Steve hawkins about ofbiz is way off. I don’t know how you can compare a half glued together SOA engine to a IOC container and a framework like Spring. ofbiz is made of a bunch of frameworks I would not even consider. Good luck if you think this is a sound technology choice. The licenses are not even all compatible.