This series of articles aims to introduce the Spring Framework and show you how to quickly get common things done using the Spring Framework and other open source projects.
The Spring Framework is an application framework started by Rod Johnson and Juergen Holler that aims to simplify J2EE development. From the Spring Framework official site, Spring’s mission statement:
We believe that:
- J2EE should be easier to use
- It’s best to program to interfaces, rather than classes. Spring reduces the complexity cost of using interfaces to zero.
- JavaBeans offer a great way of configuring applications.
- OO design is more important than any implementation technology, such as J2EE.
- Checked exceptions are overused in Java. A framework shouldn’t force you to catch exceptions you’re unlikely to be able to recover from.
- Testability is essential, and a framework such as Spring should help make your code easier to test.
Our philosophy is summarized in Expert One-on-One J2EE Design and Development by Rod Johnson (the examples in this book were the starting point for building the Spring Framework).
We aim that:
- Spring should be a pleasure to use
- Your application code should not depend on Spring APIs
- Spring should not compete with good existing solutions, but should foster integration. (For example, JDO and Hibernate are great O/R mapping solutions. We don’t need to develop another one.)
Spring’s goal is to be an entire Application framework. Struts and other popular frameworks are primarily Web frameworks. Spring fills in the rest of the infrastucture that is needed in a framework that is not provided by the web frameworks. Spring integrates nicely with most of these web frameworks including Struts, Tapestry, Webwork, and JSF, but it also provides an elegant MVC layer to replace these frameworks, if desired.
This is not a comprehensive resource on Spring, there are several excellent books and websites out there for that (detailed below). Spring at its core is extremely simple, but the scope of all of the feature and integration points that Spring provides is HUGE.
I will present a series of tutorials to introduce several Spring features that are typically needed in applications. In each tutorial, I will give a brief introduction and provide some sample code that should help you jumpstart solving real problems with the Spring Framework.
Further Reading
Here are some excellent resources for Spring and Spring related topics:
- The Official Spring Reference Manual
- Spring in Action by Craig Walls and Ryan Breidenbach
- Pro Spring by Rob Harrop and Jan Machacek
Next: Introducing Spring BeanFactories