The (or '''Spring''' for short) is an ,
October 2002 ). A port is available for the .NET Framework.
The framework was first released under the
Apache 2.0 License in June 2003. The first milestone release was 1.0 which was released in March 2004 with further milestone releases in September 2004 and March 2005.
Although the Spring Framework does not enforce any specific
Programming Model it has become widely popular in the Java community primarily as an alternative and replacement for the
Enterprise JavaBean model. By design, the framework offers a lot of freedom to Java developers yet provides well-documented and easy to use solutions for common practices in the industry.
While the core features of the Spring Framework are usable in any Java application there are many extensions and improvements for building web-based applications on top of the
Java Enterprise Platform . Spring has gained a lot of popularity because of this and is recognized by vendors as a strategically important framework .
The first parts of what has become the Spring Framework were written by Rod Johnson in 2000 while he was working as an independent consultant for customers in the financial industry in
London . While writing his book ''Expert One-on-one J2EE Design And Development (Programmer to programmer)'' (2002) he further expanded this code to express his views on how applications that work with various parts of the
J2EE Platform could become simpler and more consistent than developers and companies were used to at that time.
Back in 2001 the dominant programming models for web-based applications were offered by the
Java Servlet API and
Enterprise JavaBean s. Both are specifications created by
Sun Microsystems in collaboration with other vendors and interested parties and enjoy great popularity in the Java community. Applications that aren't web-based like client-based applications or batch applications could be based on
Open Source and commercial tools and projects that provided required features.
Rod Johnson is credited for creating a framework that was based on accepted best practices and available to all application types, not just web-applications. These ideas are also expressed in his book, and after its publication readers requested that code be provided, which was subsequently shipped with the book under an
Open-source License .
A small team of developers willing to work on extending the framework was formed and a project home was created on
Sourceforge in February 2003. After working on the framework for more than one year they made their first release (1.0) in March 2004. After this release the framework gained a lot of popularity within the Java community, this is in part due to the higher than average standard of the
Javadoc and reference documentation for an
Open Source project.
However, the Spring Framework was also heavily criticized in 2004 and remains the subject of sometimes heated discussions. At the time of its first major release many developers and thought leaders saw the Spring Framework as a move away from the traditional programming model; this was especially true for
Enterprise JavaBean s. One of the design goals of the Spring Framework is to easily integrate with existing
J2EE standards and vendor tools. To a large extent this removes the need to define its features in an official committee-controlled specification document which is criticized by some.
The Spring Framework made previously unfamiliar techniques popular in a short period of time, the most notable example is
Inversion Of Control . In 2004 the Spring Framework enjoyed high adoption rates and by offering its own
Aspect-oriented Programming (AOP) framework it also helped to make this programming paradigm more popular within the Java community.
2005 saw even higher adoption rates than the previous year thanks to new milestone releases and more features being added. The
Spring Forum that was launched at the end of 2004 also helped to increase the framework's popularity and has since grown out to be the most important source of information and help for its users.
In the same year the Spring developers started their own company to offer commercial support and notably started a partnership with attracting 300 developers over the course of 3 days, followed by a conference in
Antwerp in June 2006, attended by over 400 people.
- Built-in generic strategies for JTA and a single JDBC DataSource. This removes the dependency on a Java EE environment for transaction support.
- Extensive Aspect-oriented Programming framework to provide services such as transaction management. As with the Inversion-of-Control parts of the system, this aims to improve the modularity of systems created using the framework.
The Spring Framework provides solutions to many technical challenges faced by Java developers and organizations wanting to create applications based on the
Java Platform . Because of the sheer vastness of the functionality that is offered it can be hard to distinguish the major building blocks the framework is composed of. The Spring Framework is not exclusively linked to the
Java Enterprise Platform although its far-reaching integration in this area is an important reason for its popularity.
The Spring Framework is probably best known for offering features required to effectively create complex business applications outside of the programming models that historically have been dominant in the industry. Next to that it is also credited for introducing previously unfamiliar functionalities into today's mainstream development practices, even beyond the Java platform.
This amounts to a framework that offers a consistent model and makes it applicable to most application types that are created on top of the Java platform today. The Spring Framework is considered to implement one way of working based on best practices and industry standards and making it available to many domains in Java.
The Spring Framework can be considered as a collection of smaller frameworks or frameworks-in-the-framework. Most of these frameworks are designed to work independently of each other yet provide better functionalities when used together. These frameworks are divided along the building blocks of typical complex applications:
- : configuration of application components and lifecycle management of Java objects.
- ''' capabilities without making sacrifices.
- ''' on the Java platform using JDBC and Object-relational Mapping tools providing solutions to technical challenges that are reusable in a multitude of Java-based environments.
- : harmonization of various transaction management API's and configurative transaction management orchestration for Java objects.
- ''' and Servlet based framework providing many hooks for extension and customization.
- : configurative RPC -style export and import of Java objects over computer networks supporting HTTP -based protocols, RMI , CORBA and Web Services ( SOAP ).
- '''.
- : configurative exposure and management of Java objects for local or remote configuration via JMX .
- : configurative registration of message listener objects for transparent message consumption from Message Queue s via JMS , improvement of message sending over standard JMS API's.
- framework: support classes for writing unit tests and integration tests.
Central in the Spring Framework is its
Inversion Of Control container that provides a consistent means of configuring and managing Java objects. This container is also known as ''BeanFactory'', ''ApplicationContext'' or ''Core container''.
The container has many responsibilities and extension points that can all be considered as forms of Inversion of Control, hence its name. Examples are: creating objects, configuring objects, calling initialization methods and passing objects to registered callback objects. Many of the functionalities of the container together form the object lifecycle which is one of the most important features it provides.
Objects that are created by the container are also called ''Managed Objects'' or ''Beans''. Typically the container is configured by loading XML files that contain ''Bean definitions''. These provide all information that is required to create objects. Once objects are created and configured without raising error conditions they become available for use. Objects can be obtained by means of ''Dependency lookup'' or ''
Dependency Injection ''.
''Dependency lookup'' is a pattern where a caller asks the container object for an object with a specific name or of a specific type. ''Dependency injection'' is a pattern where the container passes objects by name to other objects, either via
Constructor s, properties, or
Factory Methods .
In many cases it's not necessary to use the container when using other parts of the Spring Framework although using it will likely make an application easier to configure and customize. The Spring container provides a consistent mechanism to configure applications and integrates with almost all Java environments, from small-scale applications to large enterprise applications .
The container can be turned into a partially-compliant
EJB3 container by means of the
Pitchfork project. This project by itself however does not make the container fully compliant with the EJB3 specifications. The Spring Framework is criticized by some as not being standards compliant.
Interface21 doesn't see EJB3 compliance as a major goal and claims the Spring Framework and the container allow for more powerful programming models