
Already know some of this? A 2-minute test skips the lessons you know.
Take the placement testA free 9-lesson course built from Coder Army's 1h 28m of YouTube video. 1 day at 90 minutes a day, with study notes and a quiz in every lesson. A 2-minute placement test skips what you already know.
Taught by Coder Army on YouTube. Videos play in YouTube's own player, so the creator keeps every view.
Understand the complete Spring bean lifecycle from creation to destruction, and set up a Maven project with Spring Context dependency to demonstrate lifecycle phases.
Explain how the IoC container starts, reads configuration classes via reflection, and scans for @Component and @Bean annotated classes to manage.
Describe how Spring reads bean definitions (metadata) including bean name, scope, initialization mode, and dependencies before instantiation.
Implement BeanNameAware and ApplicationContextAware interfaces to receive callbacks with bean metadata like name and container reference after dependency injection.
Compare three initialization callback mechanisms (InitializingBean interface, @PostConstruct annotation, init-method) to perform setup logic after properties are set but before bean usage.
Justify using @PostConstruct instead of constructors for heavy initialization, emphasizing that constructors should stay lightweight and dependencies are fully injected only after construction.
Implement three destruction callback styles (DisposableBean interface, destroy-method, @PreDestroy annotation) to release resources or invalidate caches before bean removal from the IoC container.
Use ConfigurableApplicationContext.close() to trigger destruction callbacks and observe the complete lifecycle from constructor to @PreDestroy in console output.
Contrast eager singleton lifecycle with @Lazy (deferred instantiation) and @Scope(prototype) (new instance per request, no destruction callbacks, garbage-collected).