The most fitting definition of Spring is perhaps the one given by the authors themselves, who define it:
«an open source framework created with the aim of managing the complexity in the development of enterprise applications.»
- This definition raises some questions in those who already know the Java world and are approaching Spring for the first time, the first of which is: “why learn this framework and prefer it to the myriad of existing and established ones?”
- The question, which at first may appear trivial, instead offers a key to fully illustrating the advantages offered by Spring, which, although developed after many other frameworks, stands out as one of the best and most complete.
- The answer to this question is actually not simple and can partly be summarized in the following points:
Spring is a “light” framework and thanks to its extremely modular architecture it is possible to use it in its entirety or only in part. The adoption of Spring in a project is very simple, it can happen incrementally and does not upset the existing architecture. This peculiarity also allows for easy integration with other existing frameworks, such as Struts.
Spring is a lightweight container and is proposed as an alternative/complement to J2EE. Unlike the latter, Spring offers a simpler and lighter model (especially compared to EJB) for the development of business entities. This simplicity is strengthened by the use of technologies such as Inversion of Control and Aspect Oriented which give greater depth to the framework and encourage the developer to focus on the essential application logic.
Unlike many frameworks that focus more on providing solutions to specific problems, Spring provides a complete set of tools to manage the entire complexity of a software project. We will analyze in detail the tools offered by this framework, for now it is sufficient to state that Spring provides a simplified approach to most of the recurring problems in software development (database access, dependency management, testing, etc.).
Spring is a framework born with the idea that quality code should be easily tested. This philosophy means that, with Spring, it is very easy to test the code and, thanks to this peculiarity, the framework has carved out an important space for itself in those areas where testing is considered a fundamental part of the software project.
Throughout the guide we will have the opportunity to better answer the question posed and other doubts that arise every time we approach studying a new framework.