Spring

Spring is an amazing framework. Those who are working in Java and have worked with Spring in the past or are working with it presently already know its benefits. Those who are in Java but didn't work in Spring yet should consider it seriously. Spring is a lightweight framework that basically works on plain POJO objects with the dependencies injection principle. The responsibility of creating a new bean or object is taken by the framework itself. The life cycle of these types of objects is maintained by the framework. It encourages the modular approach in programming. AOP and transaction management are some of the essential bits in any project; these are provided by Spring with the boiler plate code available.

Architecture wise, Spring has a core container and many other projects to support various needs. Spring core container includes the following modules:

  • Spring code module
  • Spring bean modules
  • Spring context
  • Spring Expression Language (SpEl)

On top of these core modules, Spring has many other modules for making a robust Java-based application. Modules for database access, transaction management, security, Spring integration, batch processing, messaging, social plugin, Spring cloud, and so on; some of the modules that make code much simpler and easy to do efficiently. The benefits of Spring can take a whole book to discuss, and discussing the benefits of Spring is out of the scope of this book. So, in a nutshell, the Spring moulder approach is helpful for a Java-based developer to write a cleaner and efficient code. However, there is a small pitfall of Spring in terms of configuration. An average application written in Spring is likely to use more than four modules of Spring (core container, Spring MVC transaction management, database access). As the project grows, these module numbers can increase, and configuration and compatibilities between different versions of modules can become cumbersome. To make life easy for a developer, Spring Boot comes into the picture.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset