Introduction to Spring Framework

Welcome to Spring Framework Tutorial. In this article, we will understand the Spring framework with its features. In order to understand Spring Framework first, we will see what is Framework?

Note:

If you are a beginner, it is recommended to start with the core feature of Java before directly moving on to Spring Framework. You can check the Core Java article here Java Tutorial Introduction.

What is a Framework?

The framework provides a foundation for any programming language. It has some predefined classes and libraries build.

  • In the Java programming language, there are some frameworks with predefined classes and methods that can be used in the development process.
  • There are some popular open-source Java Frameworks in the market such as Quarkus, Grails, Google Web toolkit, Struts, Spring and etc.

  • Using Framework helps us to adhere to the Industry standard because, at the Industry level, every company is using the Framework.

So, Let’s understand Spring Framework and Why everyone is using Spring.

What is Spring Framework?

Spring Framework is designed to build robust Enterprise Java applications. It is an open-source Framework available to create the J2EE application fast. Its main advantage is it is fully documented. (you can check it here https://spring.io/). It is also one of the popular frameworks we have now. But, what makes it popular. So, let us see. The two most important features are:(we will see in detail in the coming tutorial)

  • Dependency Injection
  • Aspect-Oriented Programming.

There are core functionality provided by this framework that can be used with any Java application, but if we want to build a Web-based application Spring can provide us the extension also.

It is reported that around 503 companies use Spring Framework in their tech stacks including Accenture, MIT, Zillow and, so on.

There is a vast community of developers which favors Spring Framework because It provides much support such as Web Application Support, Mobile Application Support, Cloud Platform and, etc.

History of Spring framework

In order to go ahead, let us see the History of Spring Framework in brief like how it is evolved.

  • Spring Framework First version was written by Rod Johnson in the year 2002 with the publication of his book Expert One-on-One J2EE Design and Development. It was released under Apache license 2.0
  • Then came Spring 2.0 in 2006 which simplified XML config.
  • Spring 2.5 came in 2007, introduced Annotation-based configuration.
  • ¬†Spring 3.2 came in 2012, introduced Java configuration, and had support for Servlet3.0.
  • Spring 4.0, had support for Java 8 released in 2014.
  • Now, the current version is Spring 5.0 which came in 2017.

Features of Spring Framework

Till now we got the idea of the popularity of the Spring Framework but what makes it so popular among the Industry? It’s the Feature of Spring Framework that we see one by one.

  • Inversion of Control(IOC)/Dependency Injection

The most important feature of the Spring Framework where developers don’t need to worry about creating objects. It would be taken care of by the Spring Framework itself.

  • Aspect-Oriented (AOP)

AOP separates the secondary or supporting function from the main program’s business logic which makes the application modular.

  • Lightweight

It is a lightweight framework because its basic version size is 1MB.

  • POJO Based

POJO stands for Plain Old Java Objects that are not bound by any special restriction also increase the readability and re-usability.

  • Modular

Spring Framework is developed in a modular way. Every component is added in a modular way.

  • Integration with existing Framework

Spring Framework can easily be integrated with the available framework such as Hibernate, JDK Timers and, so on.

  • WebMVC

It helps us to create a robust web-based application using SpringMVC.

  • Exception Handling

Spring Framework provides us the central way of handling exceptions and has a specific API for the specific exception.

  • Testability

It is easy to test Spring Based application.

  • Transaction Management

Spring Framework provides a transaction management interface.

Advantages of Spring Framework

There are many pros of using Spring Framework such as

  • Firstly, it is developed using Java which is one of the pros of Development.
  • It is an Open Source Framework.
  • It has a vast community using this Framework.
  • It is a powerful framework because of the features it provides.
  • It does not require a tiresome setup. It is easy to set up.
  • It has good documentation already created.
  • It provides supports for MVC using SpringMVC.

Thus, this was all about Spring Framework Introduction. In the next article of this tutorial, we will see the Architecture of Spring Framework.