Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 25-04-2009
Member
 
Join Date: Apr 2009
Posts: 69
Why Spring, Benefits using spring framework?

Hello Programming gurus,

I have heard about Spring Framework, but unaware about its structure as well as its benefits so can anyone here suggest me why do I prefer Spring and what are the advantage using Spring Framework,.

I will appreciate your help.
Thanks
Reply With Quote
  #2  
Old 25-04-2009
Member
 
Join Date: Jan 2009
Posts: 48
Re: Why Spring, Benefits using Spring Framework?

Following are the several reasons why I prefer Spring Framework:
  1. It addresses important areas that other popular frameworks don't. Spring focuses around providing a way to manage your business objects.
  2. Spring is comprehensive and modular. Spring has a layered architecture, meaning that you can choose to use just about any part of it in isolation, yet its architecture is internally consistent. So you get maximum value from your learning curve. You might choose to use Spring only to simplify use of JDBC, for example, or you might choose to use Spring to manage all your business objects. And it's easy to introduce Spring incrementally into existing projects.
  3. Spring is designed from the ground up to help you write code that's easy to test. Spring is an ideal framework for test driven projects.
  4. Spring is an increasingly important integration technology, its role recognized by vendors large and small.
  5. The Spring Framework is the core of the Spring Portfolio , an increasingly complete solution for enterprise Java development, exhibiting the same consistency of approach developed in the Spring Framework itself.
Reply With Quote
  #3  
Old 25-04-2009
Member
 
Join Date: Dec 2008
Posts: 202
Re: Why Spring, Benefits using spring framework?

Architectural benefits of Spring
  • Spring can effectively organize your middle tier objects. Spring takes care of plumbing that would be left up to you if you use only Struts or other frameworks geared to particular J2EE APIs. And Spring's configuration management services can be used in any architectural layer, in whatever runtime environment.
  • Spring can eliminate the proliferation of Singletons seen on many projects. In my experience, this is a major problem, reducing testability and object orientation.
  • Spring eliminates the need to use a variety of custom properties file formats, by handling configuration in a consistent way throughout applications and projects. Ever wondered what magic property keys or system properties a particular class looks for, and had to read the Javadoc or even source code? With Spring you simply look at the class's JavaBean properties or constructor arguments. The use of Inversion of Control and Dependency Injection (discussed below) helps achieve this simplification.
  • Spring facilitates good programming practice by reducing the cost of programming to interfaces, rather than classes, almost to zero.
  • Spring is designed so that applications built with it depend on as few of its APIs as possible. Most business objects in Spring applications have no dependency on Spring.
  • Applications built using Spring are very easy to test. For certain unit testing scenarios, the Spring Framework provides mock objects and testing support classes. Spring also provides unique ?integration testing? functionality in the form of the Spring TestContext Framework and legacy JUnit 3.8 support classes that enable you to test your code quickly and easily, even while accessing a staging database.
  • Spring helps you solve problems with the most lightweight possible infrastructure. Spring provides an alternative to EJB that's appropriate for many applications. For example, Spring can use AOP to deliver declarative transaction management without using an EJB container; even without a JTA implementation, if you only need to work with a single database, or want to avoid two phase commit.
  • Spring provides a consistent framework for data access, whether using JDBC or an O/R mapping product such as TopLink, Hibernate or a JPA or JDO implementation.
  • Spring provides a consistent, simple programming model in many areas, making it ideal architectural "glue." You can see this consistency in the Spring approach to JDBC, JMS, JavaMail, JNDI and many other important APIs.
Reply With Quote
  #4  
Old 25-04-2009
Member
 
Join Date: Oct 2008
Posts: 167
Re: Why Spring, Benefits using spring framework?

If you use Spring you can scale up in power a bit. Some of the benefits are:
  • Declarative transactions.
  • More testable code.
  • Promotes good OO design
  • Removes boilerplate code
  • Great lightweight remoting support
  • Good documentation and samples.

Spring MVC also has advantages over Stuts:
- No ActionForms. Bind directly to domain objects
- More testable code (validation has no dependency on Servlet API)
- Well defined interface to business layer

For example of Spring reducing the boilerplate code, it can turn:

Code:
public List findAllEmployees() {
SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
Session session = sessionFactory.getSession();
try {
return session.find("from Employee order by surname, firstname");
} finally {
try {
session.close()
} catch(HibernateException he) {
throw new CustomRuntimeDAOException(he);
}
}
}
into
public List findAllEmployees() {
return getHibernateTemplate().find("from Employee order by surname, firstname");
}
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Why Spring, Benefits using spring framework?"
Thread Thread Starter Forum Replies Last Post
Need help with spring mvc project Aninch Software Development 9 10-01-2012 07:02 PM
spring framework ajnabi81 Software Development 1 09-07-2010 04:29 AM
JSF Framework Vs Spring Framework Bottlenecked Software Development 5 30-01-2010 10:11 AM
What is Spring? Adrina_g Software Development 3 10-12-2009 01:56 PM
Need Help on Spring Framework: Learning dhamayanthik Software Development 1 15-06-2009 01:02 PM


All times are GMT +5.5. The time now is 02:26 PM.