Spring (framework)

from Wikipedia, the free encyclopedia
Jump

Spring Framework Logo 2018.svg
Basic data

developer Pivotal software
Publishing year October 1, 2002
Current  version 5.2.8
( July 21, 2020 )
operating system platform independent
programming language Java , Kotlin , Groovy
category Framework
License Apache license
spring.io/projects/spring-framework

The Spring Framework ( Spring for short ) is an open source framework for the Java platform, which is often used for web applications. The aim of the Spring Framework is to simplify development with Java / Java EE and to promote good programming practices. With a wide range of functionality, Spring offers a holistic solution for developing applications and their business logics; The focus here is on the decoupling of the application components.

properties

The framework is based on the principles presented in Rod Johnson's book Expert One-On-One J2EE Design and Development :

  • Dependency Injection : The objects are the required resources allocated and objects. You don't have to look for it yourself.
  • Aspect-oriented programming (AOP): This allows the programmer to isolate technical aspects such as transactions or security and keep the actual program code free. In addition to Spring AOP, Spring provides good support for AspectJ and its Pointcut Expression Language .
  • Templates are used to simplify work with some programming interfaces (APIs) by automatically cleaning up resources and handling error situations in a uniform manner.

This enables a POJO -based programming model in which the POJOs can also be run in different environments (on a server or in a client application).

Extensions

On the basis of the Spring framework, there are other projects that are being developed within the Spring project:

Spring .NET
is the porting of the Spring framework on the .NET platform.
Spring boot
for the simple development of independently executable Spring applications by convention prior to configuration , which manage without XML configuration and which have all the necessary class libraries .
Spring AMQP
for access to AMQP -based Message Oriented Middleware
Spring batch
for mapping batch processes on the Java platform.
Spring BeanDoc
for the creation of documentation for the Spring framework configurations.
Spring Data
for access to various relational and NoSQL databases
Spring Dynamic Modules for OSGi Service Platforms
for the implementation of Spring applications based on the OSGi framework.
Spring Extensions (Modules)
for connecting other frameworks that are not included in the Spring framework itself.
Spring IDE
for developer support in the creation and maintenance of Spring applications.
Spring integration
for the implementation of integration logic with a Spring-compliant programming paradigm.
Spring BlazeDS integration
is the open source solution for creating Spring-supported RIA applications with Adobe Flex .
Spring LDAP
for easier access to LDAP systems.
Spring MVC
for creating web applications.
Spring rich client
for creating rich clients based on the Spring framework.
Spring Roo
for the rapid generation of Spring-based enterprise applications.
Spring Security
(formerly Spring Acegi) to secure Java applications and websites.
Spring Social
offers a simplification for access to various social networks .
Spring Web Flow
for the implementation of processes on a website.
Spring Web Services
for the creation of contract-first web services .
ColdSpring ColdFusion
is the port of the Spring framework to the ColdFusion platform.
Spring for Android
is an extension designed to facilitate the creation of native Android apps.

The open source project Spring Modules , which has since been discontinued, also offers a range of tools and extensions for Spring, including B. Integration with Ant , Flux, HiveMind , Lucene , Apache OJB , Tapestry , support for caching services, db4o , rules engines , various Jakarta-Commons components, JavaSpaces , jBPM , extensions for Spring MVC and bean validation.

comparison

Spring competes directly with other dependency injection frameworks such as PicoContainer or Google Guice , but offers more than these due to its support for aspect-oriented programming and the simplification of existing programming interfaces.

Compared to Enterprise Java Beans 3.0 , which is also POJO-based and supports dependency injection, there are the following differences:

  • EJB 3.0 supports Dependency Injection only for JNDI objects or complex service objects, while Spring supports all objects - including POJOs among each other.
  • Springs dependency injection model is much more flexible. It offers various options for intervening in the dependency injection process and supports a large number of different programming and configuration options.
  • EJB 3.0 supports the interceptors from aspect-oriented programming only for beans. With the Spring AOP framework, however, it has always been possible to integrate application-specific interceptors for every object.
  • With Spring Security, Spring enables access control at instance level, access control under EJB 3.0, on the other hand, is role-based, so different access authorizations for users with the same roles cannot be implemented.

At the same time, Spring supports many of the annotations of EJB 3.0, so that a similar programming model is possible.

Spring boot

Spring Boot offers a simplified configuration of a Spring application. With the help of the so-called Spring Initializer, dependencies such as B. web frameworks, database drivers, messaging components or software for cloud infrastructure can be selected so that manual configuration of the project is not necessary. In contrast to classic Spring applications, in which several XML configuration files had to be edited, Spring Boot enables a new project to be created quickly. This also promotes Spring Boot as a method for creating microservices .

Spring Boot is not an alternative to the Spring Framework, but mainly simplifies the configuration. By integrating so-called "starters" in Maven or Gradle , a suggested standard configuration is provided. For example, the starter “spring-boot-starter-web” automatically configures an integrated Tomcat web server by default. Further configurations can be made by scanning the class path. If the JDBC driver for PostgreSQL is present in the classpath, a PostgreSQL connection is automatically configured.

history

Rod Johnson first introduced the ideas for Spring in his book Expert One-On-One J2EE Design and Development (2002) and provided source code as accompanying material. In February 2003 the source code was made available for the first time on SourceForge as an open source project and at that time was named Spring Framework. In June 2003 the first release appeared in version 0.9 under the Apache 2.0 license. The official 1.0 release of Spring was released in March 2004. Since then, the Spring framework has found widespread use in a few years and is used in a variety of applications.

Version 1.1 was released in September 2004 with bug fixes and numerous new functions. Version 1.2, released in May 2005, already supported some Java 5 functionalities with simultaneous downward compatibility with older Java versions. In December 2005 the Spring developers announced version 2.0, which then brought a lot of new functions and was released in October 2006.

By the time version 2.0 was released, the Spring framework had already been downloaded a million times and won a JAX Innovation Award and a Jolt productivity award in 2006 .

Version 2.5 was released on November 19, 2007. Originally the development was planned as version 2.1, but due to the many new functions, version 2.5 became the successor to version 2.0.x. Spring 2.5 fully supports the Java 6 version as well as the Java EE version 5 with simultaneous downward compatibility with Java 1.4 and Java EE 1.3. Spring 2.5 also supports annotations for configuring application components .

SpringSource was acquired by VMware in September 2009 .

Version 3.0 was released on December 16, 2009. Among other things, an Expression Language u. a. for the configuration of the Spring Beans and support for REST . In addition, the Java-based configuration from the Spring-Java-Config project was integrated into Spring 3.0. The main innovations of version 3.1 were the portable cache abstraction and the support of configuration profiles, in which different Spring Beans are generated depending on the environment. In addition, web conversations are introduced that can be used to manage status that must be available across multiple web pages.

The Spring framework is still being further developed by the Spring core developers, including Jürgen Höller, Rod Johnson and Rob Harrop. The SpringSource Division of VMware, formerly Interface21 , employs most of the active developers of the project and offers A. Advice, training and support on Spring. In April 2013, the VMWare subsidiary, which had meanwhile been renamed from SpringSource to Spring, was spun off into a newly founded joint venture between VMware, EMC Corporation and General Electric . This company is called Pivotal Software Inc.

Spring Dynamic Modules for the OSGi Platform (formerly Spring-OSGi)

Spring Dynamic Modules acts as a bridge between the Spring framework and OSGi . Applications based on the Spring framework can be implemented with OSGi. The basic idea is to provide Spring in the form of bundles. The dynamic features of OSGi should be used.

Each bundle has its own application context. Spring beans can be offered as OSGi services, OSGi services can be consumed as spring beans. Services can be installed and uninstalled dynamically. The current release is Spring Dynamic Modules 1.1.2, which was released on October 3, 2008.

SpringSource dm server

The use of OSGi for enterprise applications leads to some problems, since OSGi handles the loading of the classes differently. This can lead to incompatibilities and more complex problems, since an O / R mapper like Hibernate , for example , is dependent on modifying the code of the persistent objects. The SpringSource dm server offers solutions for these problems and also makes it easier to use Spring. It is based on Apache Tomcat for the support of web applications and Equinox as an OSGi implementation. The SpringSource dm server is an open source project under the GNU General Public License (GPL). The sources are now the basis for the Eclipse Virgo project, which is licensed under the Eclipse Public License .

See also

literature

  • Thomas Biskup, Sven Helmberger, Holger Spielmann, Rafael Stalitza, Sascha Steiger, Nils Wloka: Spring Praxishandbuch: Integration and Testing . Developer Press, 2008, ISBN 978-3-939084-39-6 .
  • Thomas Biskup, Rafael Stalitza, Sascha Steiger, Nils Wloka: Spring Praxishandbuch: Volume 2: Dynamization, Distribution and Security . Developer Press, 2009, ISBN 978-3-86802-022-9 .
  • Rod Johnson, Jürgen Höller, Alef Arendsen, Thomas Risberg, Colin Sampaleanu: Professional Java Development with the Spring Framework . Wiley, 2005, ISBN 0-7645-7483-3 .
  • Jan Machacek, Aleksa Vukotic, Anirvan Chakraborty: Pro Spring 2.5 . APress, 2005, ISBN 1-59059-921-7 .
  • Richard Oates, Thomas Langer, Stefan Wille, Torsten Lueckow, Gerald Bachlmayr: Spring & Hibernate. A practical introduction , Hanser Verlag, 2006, ISBN 978-3-446-40457-1 .
  • Mark Pollack, Oliver Gierke, Thomas Risberg, Jon Brisbin, Michael Hunger: Spring Data , O'Reilly, 2012, ISBN 978-1-4493-2395-0 .
  • Craig Walls: Spring in action . Carl Hanser Verlag, Munich 2008, ISBN 978-3-446-41240-8 .
  • Craig Walls: Spring in Action (5th Edition). Manning Publishing, New York 2018, ISBN 978-1-617294-94-5
  • Eberhard Wolff: Spring 3 - Framework for Java Development . dpunkt, 2010 (3rd, extended edition), ISBN 3-89864-572-X . http://spring-buch.de
  • Alfred Zeitner, Birgit Linner, Martin Maier, Thorsten Göckeler: Spring 2.5: A pragmatic introduction . Addison-Wesley, 2008, ISBN 978-3-8273-2622-5 .
  • Michael Simons: Spring Boot 2 - Modern software development with Spring 5 . dpunkt, 2018, ISBN 978-3-86490-525-4 . http://springbootbuch.de

Web links

Individual evidence

  1. github.com .
  2. ^ A b "Expert One-On-One J2EE Design and Development", wrox Press, October 2002, ISBN 0-7645-4385-7 .
  3. Spring Modules Features  ( page no longer available , search in web archivesInfo: The link was automatically marked as defective. Please check the link according to the instructions and then remove this notice. . Various Spring Extension projects take its place.@1@ 2Template: dead link / springmodules.dev.java.net  
  4. JAX Innovation Award Winner 2006 ( Memento of the original from August 17, 2009 in the Internet Archive ) Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice. @1@ 2Template: Webachiv / IABot / jax-award.de
  5. Jolt winners 2006
  6. SpringSource Blog , Spring Framework 3.0 goes GA
  7. ^ Gartner , GE Joins EMC and VMware in a Joint Venture to Challenge Software Megavendors in the Cloud