Spring Core
A container instead of assembling the application by hand
In a regular Java program, objects are often created with new right where
they are needed. That is convenient in a small project, but as the application grows, relationships between classes
become more complicated. Spring Core solves exactly this problem: it creates application objects,
connects them to each other, and manages them inside a container.
In this section, we will cover the foundation on which Spring Boot, Spring MVC, data access, transactions, security, and other parts of the Spring ecosystem are built.
What is inside this section
- IoC and Dependency Injection. We will see why an object should receive ready-to-use dependencies instead of creating them itself.
- ApplicationContext. We will meet Spring's main container and see how to obtain managed objects from it.
- Spring Beans. We will find out what Spring calls a bean and how such an object differs from a regular Java object.
- Bean Lifecycle. We will follow a bean from creation to destruction and see the points where Spring can run additional logic.
- Bean Scopes. We will learn how many instances of a bean the container may create and what that depends on.
- Component Scanning. We will see how Spring automatically finds application classes and registers them in the container.
- Java Configuration. We will learn to describe container configuration with regular Java code.
- BeanPostProcessor. We will meet the mechanism that can process beans before and after initialization.
- Spring Events. We will cover the built-in way to pass events between parts of one application.
- Spring AOP. We will see how to move repetitive technical logic out of business code.
- Spring Proxies. We will understand what objects let Spring intercept method calls and add extra behavior.
The topics move from the basic idea of a container to the mechanisms Spring builds on top of it. First, it is important to understand who creates objects and how their relationships appear, and only then — how the container extends their behavior and reacts to what happens inside the application.