Let us discuss some of the advantages of Spring Framework.
Key Advantages of Spring Framework
- No need of Application Server:Spring enables the developers to develop enterprise applications using POJOs (Plain Old Java Object). The benefit of developing the applications using POJO is, that we do not need to have an enterprise container such as an application server.
- Lightweight and Modular:Spring is modular lightweight framework which allows you to selectively use any of its module on the top of Spring Core.
- Loose Coupling via Inversion Of Control (IOC): In Spring Framework, loose coupling is achieved using Inversion of Control. The objects give their own dependencies instead of creating or looking for dependent objects.
- Aspect Oriented Programming (AOP): By separating application business logic from system services, Spring Framework supports Aspect Oriented Programming and enables cohesive development.
- Container: Spring Framework creates and manages the life cycle and configuration of application objects.
- MVC Framework: Spring Framework is a MVC web application framework. This framework is configurable via interfaces and accommodates multiple view technologies.
- Transaction Management:For transaction management, Spring framework provides a generic abstraction layer. It is not tied to J2EE environments and it can be used in container-less environments.
- Predefined Templates:Spring framework provides templates for JDBC, Hibernate, JPA etc. technologies. So there is no need to write too much code. It hides the basic steps of these technologies.
Let’s take the example of JdbcTemplate, you don’t need to write the code for exception handling, creating connection, creating statement, committing transaction, closing connection etc. You need to write the code of executing query only. Thus, it save a lot of JDBC code.
- Ease of Testability:One the feature of Spring Dependency injection helps in gearing up testability. It simplifies the injection of test data with the use of JavaBean POJO.
Now that we are aware about the advantages of Spring Framework, let’s look into various spring topics.