• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring in Action - Alternatives

 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Google Guice and what else? Does the book mention about alternative IoC frameworks?
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joe Harry wrote:Google Guice and what else?

one more, http://www.picocontainer.org/
 
Craig Walls
author
Ranch Hand
Posts: 363
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The book doesn't really go into comparisons with other frameworks. For one thing, Spring does more than just one thing and so depending on the perspective taken, there are *several* frameworks that compare with it. From the perspective of dependency injection, there's Guice and PicoContainer (and my friend Howard Ship might want me to mention Tapestry's DI). From a web framework perspective, there's Struts and umpteen other web frameworks. From a REST standpoint, there's Restlet, Jersey and various other JAX-RS implementations.

In other words, I could probably write a whole book on nothing but the comparisons.
 
Sujoy Choudhury
Ranch Hand
Posts: 136
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, in short, you mean Spring is one single framework with all the solutions.
 
Raymond Tong
Ranch Hand
Posts: 255
2
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depends on what you are looking for.
Spring is more than Dependency Injection.
If DI is the only feature you want, you could compare it against Google Guice, PicoContainer, etc.

I have used Spring and PicoContainer.
PicoContainer wire the class for you, i.e. unlike spring, you need to specify the dependency yourself in xml files
It has a small footprint as well.

Google Guice wire the dependency through annotation.

As mentioned earlier, Spring gives you Dependency injection but also AOP, MVC, ORM, etc.
 
Craig Walls
author
Ranch Hand
Posts: 363
8
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Raymond Tong wrote:PicoContainer wire the class for you, i.e. unlike spring, you need to specify the dependency yourself in xml files


Hold on...just to avoid spreading misinformation, XML files are only one way to wire up objects in Spring. Spring also has Java configuration which is similar to the XML configuration, except that it's expressed in Java (with the power of Java available) instead of XML. Also component scanning and auto wiring offers annotated DI with minimal XML. And Spring also supports JSR-330 and the @Inject annotation.

To be abundantly clear: There are many ways to do DI in Spring.
 
Raymond Tong
Ranch Hand
Posts: 255
2
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Craig Walls wrote:
Raymond Tong wrote:PicoContainer wire the class for you, i.e. unlike spring, you need to specify the dependency yourself in xml files


Hold on...just to avoid spreading misinformation, XML files are only one way to wire up objects in Spring. Spring also has Java configuration which is similar to the XML configuration, except that it's expressed in Java (with the power of Java available) instead of XML. Also component scanning and auto wiring offers annotated DI with minimal XML. And Spring also supports JSR-330 and the @Inject annotation.

To be abundantly clear: There are many ways to do DI in Spring.

Sorry. Almost forgot spring has the annotation, because myself seen most project using XML.
Actually I just checked the spring web site and it stated that the java configuration project considered as "decommissioned".
What would be the reason behind?
 
Craig Walls
author
Ranch Hand
Posts: 363
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Raymond Tong wrote:Actually I just checked the spring web site and it stated that the java configuration project considered as "decommissioned".
What would be the reason behind?


Because now (as of Spring 3.0) it's formally part of the Spring Framework itself (not a separate project).
 
Bojan Tomic
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joe Harry wrote:Google Guice and what else?

CDI, the new standard perhaps? That's talking DI.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic