Spring framework
From Wikipedia, the free encyclopedia
The Spring framework is a layered Java application framework based on code published in Expert One-on-One J2EE Design and Development (ISBN 0-7645-4385-7). It was developed at first by Rod Johnson, Juergen Hoeller et al. who founded Interface21 for services concerning the Spring framework. The Spring Framework provides a simple approach to development that does away with numerous properties files and helper classes littering the codebase.
[edit] Key features
- Powerful JavaBeans-based configuration management, applying Inversion-of-Control (IoC) principles. This makes wiring up applications quicker and easier. The use of IoC in the Spring framework is also referred to as Dependency Injection (DI). The IoC principle used in Spring framework is a technique that externalizes the creation and management of component dependencies. Assume the case where class Foo depends on an instance of Bar to perform some kind of operation. Traditionally, Foo creates an instance of Bar using the new operator or obtains one from some kind of factory class. Using the IoC approach, an instance of Bar (or a subclass) is provided to Foo at runtime by some external process. This is the reason why the term DI is more descriptive of Spring functionality. (compared to IoC).
- Generic abstraction layer for database transaction management, allowing for pluggable transaction managers, and making it easy to demarcate transactions without dealing with low-level issues.
- Built-in generic strategies for JTA and a single JDBC DataSource. In contrast to plain JTA or EJB CMT, Spring's transaction support does not require Java EE environments.
- JDBC abstraction layer that offers a meaningful exception hierarchy (no more pulling vendor codes out of SQLException), simplifies error handling, and greatly reduces the amount of code programmers need to write. You'll never need to write another 'finally' block to use JDBC again. The JDBC-oriented exceptions comply with Spring's generic DAO (Data Access Object) exception hierarchy.
- Integration with Hibernate, JDO and iBATIS SQL Maps: in terms of resource holders, DAO implementation support, and transaction strategies. First-class Hibernate support with lots of IoC convenience features, addressing many typical Hibernate integration issues. All of these comply with Spring's generic transaction and DAO exception hierarchies.
- Flexible MVC web application framework, built on core Spring functionality. Developers have a high degree of control over this framework via strategy interfaces, and it accommodates multiple view technologies like JSP, FreeMarker, Velocity, Tiles, iText, and POI. Note that a Spring middle tier can easily combine with a web tier based on any other web MVC framework, like Struts, WebWork, or Tapestry.
- Aspect-oriented programming framework to provide services like transaction management. AOP provides the ability to implement crosscutting logic—that is, logic that applies to many parts of your application—in a single place and to have that logic applied across your application automatically.
As MVC patterns (such as Struts) often have difficulty in providing a clear framework for designing the Model part of an application, Spring's ability to work easily with such patterns means that developers can quickly refactor many unsuccessful approaches to make use of Spring's JDBC abstraction layer.
For a Spring framework tutorial, visit Wikibooks:Spring framework.
[edit] External links
- Spring Framework MVC Tutorial
- Simple Spring Demo
- Introduction to the Spring Framework by Rod Johnson
- The Spring Reference Documentation (PDF, 1329 kb) - Rod Johnson et al. (2004-2005)
- Interface21 offers Spring from the Source i.e. services from the developers of the Spring framework.
[edit] References
- Professional Java Development with the Spring Framework, Rod Johnson, Jürgen Höller, Alef Arendsen, Thomas Risberg, Colin Sampaleanu, Wiley, 2005, ISBN 0-7645-7483-3
- Pro Spring, Rob Harrop, Jan Machacek, APress, 2005, ISBN 1-59059-461-4
- J2EE Development Without EJB, Rod Johnson, Jürgen Höller, Wiley, 2004, ISBN 0-7645-5831-5
- Expert One-on-one J2EE Design and Development, Rod Johnson, Worx, 2002, ISBN 0-7645-4385-7
- German: Spring - Framework für die Java Entwicklung, Eberhard Wolff, dpunkt, 2006, ISBN 3-89864-365-4, http://www.spring-buch.de/
- Article on Spring Hibernate and Web Services http://jamessmith73.googlepages.com/