Results 1 to 4 of 4

Thread: Why Spring, Benefits using spring framework?

  1. #1
    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

  2. #2
    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.

  3. #3
    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.

  4. #4
    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");
    }

Similar Threads

  1. Need help with spring mvc project
    By Aninch in forum Software Development
    Replies: 9
    Last Post: 10-01-2012, 07:02 PM
  2. spring framework
    By ajnabi81 in forum Software Development
    Replies: 1
    Last Post: 09-07-2010, 04:29 AM
  3. JSF Framework Vs Spring Framework
    By Bottlenecked in forum Software Development
    Replies: 5
    Last Post: 30-01-2010, 10:11 AM
  4. What is Spring?
    By Adrina_g in forum Software Development
    Replies: 3
    Last Post: 10-12-2009, 01:56 PM
  5. Need Help on Spring Framework: Learning
    By dhamayanthik in forum Software Development
    Replies: 1
    Last Post: 15-06-2009, 01:02 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,502,657.94601 seconds with 17 queries