0Pricing
Spring Boot 4 Complete Guide · Lesson

Bean Scopes and Lifecycle Management

Learn how Spring creates, scopes, and destroys beans, and how to hook into their lifecycle with callbacks.

What Is a Bean Scope?

A scope defines how many instances of a bean Spring creates and how long they live. The default scope is singleton: one shared instance per container.

Singleton Scope

With singleton, every injection point receives the same object. This is ideal for stateless services and is the most common choice.

@Service
public class PricingService {
    // one shared instance across the app
}

All lessons in this course

  1. Understanding Spring IoC Container
  2. Dependency Injection in Practice
  3. Externalizing Application Properties
  4. Bean Scopes and Lifecycle Management
← Back to Spring Boot 4 Complete Guide