Spring framework is a lightweight application platform that provides infrastructure support for Java EE applications. Though its core concept of Dependency injection and AOP Spring handles the infrastructure so you can focus on your application.
Spring is lightweight and enables you to build applications from “plain old Java objects” (POJOs) and enterprise services are injected non-invasively to POJOs.
Spring Framework Modules
Spring framework is modular in design and this layered architecture is one of its biggest design advantage. This modular design make Spring a logical choice in many scenarios, from embedded applications that run on resource-constrained devices to full-fledged enterprise applications that use Spring’s transaction management functionality and web framework integration.
The Spring Framework consists of features organized into about 20 modules. These modules are grouped into Core Container, Data Access/Integration, Web, AOP (Aspect Oriented Programming), Instrumentation, Messaging, and Test, as shown in the following diagram.
1. The Core Container consists of the spring-core, spring-beans, spring-context, spring-context-support, and spring-expression (Spring Expression Language) modules.
spring-core and spring-beans are the foundation of the Spring framework, providing the IoC and Dependency Injection features.
spring-context builds on the features of spring-core and spring-beans and adds support for internationalization, event propagation, resource loading, and the transparent creation of contexts.
The spring-expression module provides a powerful Expression Language for querying and manipulating an object graph at runtime.
2. The spring-aop module provides aspect-oriented programming to decouple code that implements functionality that should be separated from the main functionality.
spring-aspects module provides integration with AspectJ.
The spring-instrument module provides class instrumentation support and classloader implementations to be used in certain application servers.
spring-messaging module provides abstractions for messaging-based applications.
3. The Data Access/Integration layer consists of the JDBC, ORM, OXM, JMS, and Transaction modules.
The spring-jdbc module provides a JDBC-abstraction layer.
The spring-orm module provides integration layers for object-relational mapping APIs, including JPA and Hibernate.
The spring-tx module supports programmatic and declarative transaction management.
The spring-oxm module provides an abstraction layer that supports Object/XML mapping implementations such as JAXB, Castor, JiBX and XStream.
The spring-jms module (Java Messaging Service) provides features for producing and consuming messages.
4. The Web layer consists of the spring-web, spring-webmvc, spring-webflux and spring-websocket modules.
The spring-web module provides basic web-oriented integration features
The spring-webmvc module contains Spring’s model-view-controller (MVC) and REST Web Services implementation for web applications.
The spring-webflux module brings reactive programming to Spring.
The spring-websocket module provides features to build interactive web applications.
Apart from the Spring Framework, there are other Spring projects such as Spring Boot, Spring Security, Spring Data, Spring Cloud, Spring Batch, Spring Mobile, Spring Kafka and others.
This Spring framework tutorial page also works as an index for all the Spring tutorial posts available in this blog.
Spring IoC Container
Spring Dependency Injection
- Spring Dependency Injection With Examples
- Constructor Dependency Injection in Spring
- Setter Dependency Injection in Spring
- Circular Dependency in Spring
- Injecting List, Set or Map in Spring
- Injecting Null and Empty String Values in Spring
- Injecting Prototype Bean into a Singleton Bean in Spring
- Spring Expression Language (SpEL) Tutorial
- Spring Bean Lifecycle Callback Methods
- Spring Bean Scopes
- Spring Bean Definition Inheritance
- Spring depends-on Attribute and @DependsOn Annotation
Spring Framework Examples
- Spring XML Configuration Example
- Spring Java-based Configuration Example
- Spring Component Scanning Example
- Read Values From Properties File in Spring
- Spring Autowiring Example Using XML Configuration
- Spring Autowiring Using @Autowired Annotation
- Spring Autowiring Using @Inject and @Named Annotations
- Exclude Bean From Autowiring in Spring
- Advantages and Disadvantages of Autowiring in Spring
- Spring @Autowired Annotation
- Spring @Component, @Service, @Repository, @Controller Annotations
- Spring @ComponentScan Annotation
- Spring @Conditional Annotation
- Spring @Configuration Annotation
- Spring @DependsOn Annotation
- Spring @Import Annotation
- Spring @PostConstruct and @PreDestroy Annotation
- Spring @Resource Annotation
- Spring @Required Annotation
- Spring @Scope Annotation
- Spring @Value Annotation
- Spring + JPA (Hibernate) OneToMany Example
- Fix LazyInitializationException: could not initialize proxy Error