Spring Framework Tutorial

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.
Spring framework tutorial
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.

Spring projects

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

  1. Spring IoC Container Types – ApplicationContext and BeanFactory

Spring Dependency Injection

  1. Spring Dependency Injection With Examples
  2. Constructor Dependency Injection in Spring
  3. Setter Dependency Injection in Spring
  4. Circular Dependency in Spring
  5. Injecting List, Set or Map in Spring
  6. Injecting Null and Empty String Values in Spring
  7. Injecting Prototype Bean into a Singleton Bean in Spring
  8. Spring Expression Language (SpEL) Tutorial

Spring Bean

  1. Spring Bean Lifecycle Callback Methods
  2. Spring Bean Scopes
  3. Spring Bean Definition Inheritance
  4. Spring depends-on Attribute and @DependsOn Annotation

Spring Framework Examples

  1. Spring XML Configuration Example
  2. Spring Java-based Configuration Example
  3. Spring Component Scanning Example
  4. Read Values From Properties File in Spring

Spring Autowiring

  1. Spring Autowiring Example Using XML Configuration
  2. Spring Autowiring Using @Autowired Annotation
  3. Spring Autowiring Using @Inject and @Named Annotations
  4. Exclude Bean From Autowiring in Spring
  5. Advantages and Disadvantages of Autowiring in Spring

Spring Annotations

  1. Spring @Autowired Annotation
  2. Spring @Component, @Service, @Repository, @Controller Annotations
  3. Spring @ComponentScan Annotation
  4. Spring @Conditional Annotation
  5. Spring @Configuration Annotation
  6. Spring @DependsOn Annotation
  7. Spring @Import Annotation
  8. Spring @PostConstruct and @PreDestroy Annotation
  9. Spring @Resource Annotation
  10. Spring @Required Annotation
  11. Spring @Scope Annotation
  12. Spring @Value Annotation

Spring ORM

  1. Spring + JPA (Hibernate) OneToMany Example

Spring Data

  1. Spring Data Tutorial
  2. Spring Data Query Methods
  3. Spring Data JPA Example
  4. Spring Data JPA @NamedQuery Annotation Example
  5. Spring Data JPA @Query Annotation Example
  6. Spring Data JPA Pagination and Sorting Example
  7. Spring Data JPA Auditing Example

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.