Spring Framework
Spring Framework is the foundational layer beneath Spring Boot. It provides the IoC (Inversion of Control) container that manages bean lifecycle, dependency injection that wires components together, and AOP (Aspect-Oriented Programming) that handles cross-cutting concerns. Understanding Spring core makes Spring Boot's auto-configuration predictable and debuggable.
What You'll Find Here
Notes are being added. Planned topics:
| Topic | Description |
|---|---|
| IoC Container | ApplicationContext vs. BeanFactory; @ComponentScan; bean definition and registration. |
| Dependency Injection | Constructor vs. field vs. setter injection; @Qualifier, @Primary, @Autowired. |
| Bean Lifecycle | @PostConstruct, @PreDestroy, InitializingBean, DisposableBean. |
| Bean Scopes | singleton, prototype, web scopes (request, session), scoped proxies. |
| Spring AOP | Aspects, pointcuts, advice types (@Before, @Around); JDK proxy vs. CGLIB. |
| Spring Events | ApplicationEventPublisher, @EventListener, async events with @Async. |
Learning Path
- IoC Container — the
ApplicationContextis the core of everything in Spring; understand it before the rest. - Dependency Injection — constructor injection is the modern best practice; understand why field injection hurts testability.
- Bean Lifecycle —
@PostConstruct/@PreDestroyhooks appear in nearly every Spring service. - Bean Scopes — the singleton scope interacts with concurrency; scoped proxies solve the singleton-into-prototype injection problem.
- Spring AOP — understand the proxy model to avoid the self-invocation trap (the same one that breaks
@Transactional).
Related Domains
- Spring Boot — Spring Boot auto-configures the Spring Framework container.
- Java Annotations — Spring's programming model is annotation-driven.
- Java Design Patterns — Spring implements Factory, Proxy, Template Method, and Observer internally.