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
- BeanFactory-level extensions
- Bean-level global extensions (applies to many beans)
- 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.