What is Spring?
Spring is essentially a technology dedicated to enabling you to build applications using POJOs (Plain Old Java Object). This desirable goal requires a sophisticated framework, which conceals much complexity from the developer.
In short, Spring provides a lot of functionalities:
- Inversion of control container
- JDBC abstraction and data access exception hierarchy
- O/R mapping integration
- AOP (Aspect-oriented programming)
- MVC web framework similar to Struts
- Ease EJB implementation
- Ease testing
For more information refer to: Introduction to Spring Framework. Note that CAST manages only the IoC part of Spring:
- For Spring 1.2.x, Spring beans and links between Spring beans are created.
- For Spring 2.x and above, only Spring beans are created. Annotations and XML configuration is taken into account.
Among the other tasks that you need to perform for a normal JEE analysis, here are the specifics for Spring:
In order to analyze Spring applications, you must select the appropriate Environment Profiles in your Application or Analysis Unit:
Check for each environment that your application uses the same version, otherwise duplicate the Environment Profile to preserve parametrization, change its name and select the right version of the archive.
In the Application or Analysis Unit configuration, you need to select an XML directory that contains Spring Configuration files. The selection of the Spring Environment Profile will automatically find Spring XML files and manage them. In Spring 1.2.x, Spring XML files refer to the Spring DTD (all Spring files must refer to it):
The Spring annotations are automatically taken into account when you select the Spring Framework Environment Profile.
Restitution Sample for Spring
- The main method reference the Spring Bean createCreditCard through AbstractApplicationContext.getBean() call
- The Spring Bean reference its implementation class
- The Spring Bean reference other Spring Beans (only available for Spring 1.2.x)