Skip to main content

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:

TopicDescription
IoC ContainerApplicationContext vs. BeanFactory; @ComponentScan; bean definition and registration.
Dependency InjectionConstructor vs. field vs. setter injection; @Qualifier, @Primary, @Autowired.
Bean Lifecycle@PostConstruct, @PreDestroy, InitializingBean, DisposableBean.
Bean Scopessingleton, prototype, web scopes (request, session), scoped proxies.
Spring AOPAspects, pointcuts, advice types (@Before, @Around); JDK proxy vs. CGLIB.
Spring EventsApplicationEventPublisher, @EventListener, async events with @Async.

Learning Path

  1. IoC Container — the ApplicationContext is the core of everything in Spring; understand it before the rest.
  2. Dependency Injection — constructor injection is the modern best practice; understand why field injection hurts testability.
  3. Bean Lifecycle@PostConstruct/@PreDestroy hooks appear in nearly every Spring service.
  4. Bean Scopes — the singleton scope interacts with concurrency; scoped proxies solve the singleton-into-prototype injection problem.
  5. Spring AOP — understand the proxy model to avoid the self-invocation trap (the same one that breaks @Transactional).
  • 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.