This is an English summary of the Chinese post.

Main Concepts

  • BeanFactory: the IoC container that manages bean creation and lifecycle.
  • BeanDefinition: metadata blueprint used to build beans.
  • BeanFactoryPostProcessor: extension points at container level.
  • BeanPostProcessor: extension points around bean lifecycle callbacks.

Three Layers of Extension

  1. BeanFactory-level extensions
  2. Bean-level global extensions (applies to many beans)
  3. Bean-specific lifecycle methods

Bean-Level Hooks

Commonly used lifecycle hooks include:

  • Before/after initialization hooks
  • Hooks before instantiation and before property population
  • Hooks before destruction

Understanding these hooks makes it easier to customize behavior in a clean and maintainable way.