Spring notes(二) - Ioc container
filed in Java, PHP on Mar.09, 2008, by javafuns
IOC container, in spring framework is BeanFactory, contains the following functions:
- controls the lifecycle (creation, init, destroy)
- controls the scope (like singleton, prototype, request, session, applicationcontext, new in spring)
- maintains beans’ dependence
BeanFactory is the base of the other modules in springframework.
Collection type for bean’s property:
- list
- set
- map
- props
Lazy init for bean: <bean id=”xxx” class=”xxx” lazy-init=”true”>
ApplicationContext: a more useful Ioc container which is BeanFactory’s subclass, is much more suitable for programmers to choose in their Enterprise Applications.
including more functions than BeanFactory:
- MessageResource
- Resource loading
- Event-broadcasting
- Load more than one xml files at one time




