We have multiple frameworks in Java. Spring framework is most popular out of them. Some other widely used frameworks are Struts, JSF but Spring has already dominated all of them. Let’s understand why is Spring framework so popular in this blog. Before that I would like you to focus on some basic terminologies used in the process of evolution of a Framework.
Table of Contents (Click on links below to navigate)
What is a Framework ?
Framework is a special type of software that is built on top of other technologies. It has ability to generate commonly used logics dynamically. It also provides abstraction on other technologies to simplify application/software development. eg. Spring on top of Servlet & JSP technologies, Struts on top of Servlet & JSP technologies, JSF top of Servlet & JSP technologies. Spring JDBC module top of JDBC technology.
Note that JSP, Servlet, JDBC are the Java Technologies, Java is a programming language, where as Spring, Struts, JSF are Frameworks.
What is a Spring Framework in Java ?
Spring Framework is a special type of light weight open source software built on top of Servlet & JSP technologies. It is used to develop a complete Java application without letting developer bother about commonly used logics. It provides basic functionality support for developing all kind of Java applications. In other words, Spring handles the basic infrastructure so you can focus on your application logic only.
Why is Spring so popular ?
It has many dominating features in comparison to other frameworks in Java. It is highly acceptable framework in java by industry as it has below features:
Light-Weight : Spring has dominated EJB in no time because of it’s light-weight feature. EJB was heavy-weight in comparison to Spring.
Open-Source : It is open source software, easily install-able, so adapted by industry very quickly.
Modular Architecture : It has multiple modules, we can use each module independently as per our requirement.
Easy to develop Application: As it already has commonly used functionalities of an application in built in it, developer only needs to focus on application’s business logic only.
Fast development : Spring framework modeled on the basis of real time use cases, so developing projects become very fast & easy.
Dependency Injection Feature : We just have to instruct Spring container when to instantiate which object via xml, it creates objects for us. We don’t have to create objects manually.
Using interfaces instead of classes : It provides good practice such as programming using interfaces instead of classes. It facilitates developers to develop enterprise applications using POJO and POJI model programming.
Easy test support : The Spring Test module provides support for an easy-to-test code.
AOP Support : Reduces boilerplate code via AOP(Aspect Oriented Programming) support. Boilerplate code is the code that repeats across multiple applications or in the multiple parts of the project with no change or very minimal change. eg. common connection preparation logic in JDBC comes under boilerplate code.
Now-a days companies get target to complete a project in very less time but without any compromise on quality. In such type of situations Spring framework is the best option to use.