This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Spring and the fly likes What are the main advantages of the Spring Framework? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "What are the main advantages of the Spring Framework?" Watch "What are the main advantages of the Spring Framework?" New topic
Author

What are the main advantages of the Spring Framework?

Greg Funston
Ranch Hand

Joined: Feb 09, 2011
Posts: 81

Hello, welcome to the JavaRanch. I am a new Programmer and I have seen the Spring framework and spent a little time learning it. I am not a "Spring warrior" so to speak and my exposure to different frameworks is limited.

1. What are the main advantages to Spring?
2. Why should I chose Spring over its competitors?
3. Does the advantages of learning the Spring framework come with any drawbacks/limitations?

I look forward to your replies and hopefully having time to read your book sometime soon.

Thanks.

Greg Funston SCJP
Craig Walls
author
Ranch Hand

Joined: Sep 19, 2003
Posts: 301
Greg Funston wrote:
1. What are the main advantages to Spring?
2. Why should I chose Spring over its competitors?
3. Does the advantages of learning the Spring framework come with any drawbacks/limitations?


I'm certainly going to answer this with some bias, so I welcome others to chime in with their thoughts. That said...

The primary benefits of the Spring framework (IMO) are loose-coupling with dependency injection, declarative programming (transactions, security, etc) with AOP, and a POJO-oriented model for simpler development. Taken together, these foster a development model that is geared toward solving problems rather than satisfying the whims and demands of a server.

On reason to choose Spring over its competitors is because it is the de facto standard for enterprise Java development. But that means nothing, really...what's important is why it is chosen by so many projects--because of the benefits I mentioned above, plus because the Spring "universe" spans several areas of Enterprise Java development. And, although Spring is far-reaching, that doesn't mean you *must* use it for everything. You are certainly free to pick-n-choose which parts of Spring you want to use and which parts you'll rely on some other mechanism.

I'm not sure I understand the third question...learning Spring (or anything really) expands your mind and way of thinking. I don't see any drawbacks or limitations to that, even if you find Spring isn't for you. If you're asking of Spring has any disadvantages...well, as I said, I approach this question with a bias and have to say "no".

At one time, the major drawback of Spring was that it required that you write *PAGES* of XML, even for the simplest things. But that's no longer true. Spring has a healthy mix of configuration options including a few approaches for annotation-driven development and yes, XML.


Spring in Action - Unleash POJO power in your applications!
Modular Java - Discover the secret weapon to modularity on the Java platform!
XDoclet in Action - Your complete guide to code generation with XDoclet.
Greg Funston
Ranch Hand

Joined: Feb 09, 2011
Posts: 81

Thanks, I appreciate the time it took to answer my questions. Just as a note, I do understand that your opinion is somewhat biased but that is the same as a Jaguar salesman etc. Still we always ask questions to those people who are biased but still have an in-depth knowledge of their products. Sometimes they have views which others do not express which is why we buy books from them as well. I look forward to reading the questions and answers posted in the promotion this week. Congratulations on your book as well. I know it takes a lot of hard work even to do the promotions.

Cheers,
Greg Funston SCJP
Debbie Watson
Greenhorn

Joined: Jan 12, 2014
Posts: 2
loose coupling means exactly what ?
kuldeep sidhu
Greenhorn

Joined: Jan 07, 2014
Posts: 15
Debbie Watson wrote:loose coupling means exactly what ?

In spring you can inject dependencies at runtime
e.g

In the above snippet Class Traveler and Car are tightly coupled. You are creating a car object while creating a Traveler object. In the above case if you want to implement the same case for other vehicle either you need to create new class or new method for that type of vehicle.You cant directly use the same method



In this case you can provide object of Vehicle type. Hence the same method moveVehicle() in Main class will work for all type of vehicles.
Above example shows loose coupling between Traveller and Vehicle class.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What are the main advantages of the Spring Framework?
 
Similar Threads
Spring Newbie
Spring Vs. EJB
Spring Advantages
why use Spring?
Spring and JBoss Seam