Extension Points in the Spring Bean Lifecycle

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: ...

30 September 2024

Bean Lifecycle in Spring

This post is an English summary of the Chinese article. Lifecycle Stages A Spring bean typically goes through four stages: Instantiation Dependency Injection Initialization Destruction Mapping to Native Java Instantiation: object creation through constructors. Dependency injection: assigning collaborators via setters or fields. Initialization: calling setup methods after dependencies are ready. Destruction: running cleanup methods before container shutdown. Why Spring Helps Spring standardizes these phases through built-in callbacks and annotations, so initialization and cleanup logic can be managed consistently with less boilerplate code. ...

15 September 2024

How to Get an HDU Campus Card

This is an English summary version of the original Chinese post. Quick Overview If you do not have your HDU campus card yet, there are two practical options: ...

14 September 2024