Card 06/ 06

RecapDifficulty: Intermediate1 min

Recap: The Bean and the Container

What a bean is, the two container interfaces, and the five-phase lifecycle, with where each was.

The bean and the container come down to the five ideas below, each listed with the card that covers it.

What the topic established, and which card it was on
The ideaWhere
A bean is an object the container created and manages, whatever its typeSpring Beans: Objects the Container Creates and Manages
@Component plus component scanning is enough for the container to create a beanSpring Beans Example: A Bean Found by Component Scanning
BeanFactory is the root interface; ApplicationContext extends it and is what you useBeanFactory and ApplicationContext: Spring's Two Container Interfaces
ApplicationContext creates singletons at startup, so broken wiring fails fastBeanFactory vs ApplicationContext
Instantiate, populate, initialise (@PostConstruct), ready, destroy (@PreDestroy)The Spring Bean Lifecycle: From Creation to Destruction

The populate phase is where most wiring problems appear, especially when more than one bean could fill the same dependency.