Back to: Spring Framework Tutorials
Introduction to Spring Framework
In this article, I am going to give you a brief introduction to the spring framework. So, here we will discuss, why the spring framework, what is a framework, types of framework, what is spring framework, why should we learn the spring framework and the evolution of the spring framework in detail.
Why Spring Framework?
- Java is introduced in 1995 and in the initial days of JAVA the famous programming is JAVA applets.
- With Java, applets industry developers assumed that java is only for gaming applications using applets.
- To come out of the industry path on java, SUN Microsystems introduced JAVA Beans.
- With Java Beans, the industry has identified adding services to the business is a problem.
- To solve problems with beans, SUN Microsystems introduced EJB (Enterprise Java Beans) technology.
- With EJB business logic and services can be added together but again there are some problems are identified with EJB. (1)
- Many files are needed to develop an application.
- EJB is a server-side technology some if any problem has occurred then we need to reload the application after modification, and then we need to restart the server. It is a time taken process and a burden on developers.
- To solve the problems of working with EJB, Rod Johnson has created Spring Framework.
- Spring Framework makes application development easy by injecting services to business logic created in ordinary java classes (POJO).
- Finally, Spring Framework is introduced as an alternate for EJB.
What is Framework?
- While developing Java projects, most of the projects contain some common functionality. If the common functionalities are coded by the developers in every project, then it will increase the burden on developers. In order to reduce the burden on developers, third-party vendors started providing frameworks.
- A framework is defined as an abstraction layer on top of the existing technologies and concept of java.
- With the help of frameworks, the burden on developers reduces because around 50% of the code of a project will be given by a framework only.
- With the help of frameworks, a project can be developed fastly, delivered to the clients as early as possible, and can be easily maintained.
- A framework will reduce the burden on developers. So today almost all java real-time projects are developing through frameworks.
- A framework is not a technology. It is a layer on top of existing technologies.
Types of Framework:
Frameworks are of 2 types
- Invasive: Invasive framework will force a developer to extend a framework or implement a framework interface while creating projects. For example, the Struts framework is invasive.
- Non-invasive: Non-invasive framework does not force developers to extend a framework class or implement a framework interface. For example, Hibernate and spring are the non-invasive frameworks
What is Spring Framework?
The Spring Framework is an open-source framework for building web applications with Java as a programming language. It is powerful and lightweight yet easy to use, and it provides support for developing Java applications easily. Spring is a lightweight framework that can be thought of as a framework of frameworks because it also offers support for various frameworks such as hibernate, struts, tapestry, and JSF.
Why We Should Learn Spring Framework?
Spring framework is a Java platform that provides comprehensive infrastructure support for developing Java enterprise applications. The Spring framework provides support for building the applications from “Plain old Java Objects” (POJOs). The spring is the most popular framework for developing enterprise java applications. The spring framework is used by millions of developers to create enterprise applications.
One of the core benefits of using the Spring framework is that it takes care of most of the low-level aspects of building the application. The Spring framework is enough mature and well established enough that it is very actively maintained and also has a thriving development community, which makes it quite up to date and properly aligned to the Java ecosystem.
The spring is an open-Source framework with layered architecture which allows developers to be selective about which of its components can be used while also providing a cohesive framework for J2EE application development.
The Spring Framework has grown over years from just being an Inversion of control container, and currently includes several modules that provide a range of services like Aspect-oriented programming, Data access, Transaction management, Model–view–controller, Authentication and authorization, Messaging, and Testing. Spring provides auto-wiring capabilities through which you can simply specify the interface type and Spring can find an actual type at runtime, provided there are no conflicts. Spring has become a popular alternative to the Enterprise JavaBean (EJB) model.
Evolution of Spring Framework
The framework was first released in June 2003 under the Apache license version 2.0. The first milestone release of the Spring framework (1.0) was released in March 2004. Spring 2.0, which came in 2006, simplified the XML config files. Spring 4.0, which came in 2014, had support for Java 8.
- The first version of the Spring framework was written by Rod Johnson along with a book in 2002.
- The framework was first released in June 2003 under the Apache license version 2.0.
- The first milestone release of the Spring framework (1.0) was released in March 2004.
- Spring 2.0, which came in 2006, simplified the XML config files.
- Spring 2.5, which came in 2007, introduced annotation configurations.
- Spring 3.2, which came in 2012, introduced Java configuration, had support for Java 7, Hibernate 4, Servlet 3.0, and also required a minimum of Java 1.5.
- Spring 4.0, which came in 2014, had support for Java 8.
- Spring Boot also was introduced in 2014.
- Spring 5.0 came out in 2017. Spring Boot 2.x has support for Spring 5.
In the next article, I am going to discuss the Modules of Spring Framework in detail. Here, in this article, I try to give you an overview of Spring Framework and I hope you enjoy this article.