Prochaines sessions
Programme
Introduction
- Historical background
- Motivations
- Inversion of control
- Control of dependencies
- Direct control of dependencies
- Dependency injection
Lightweight container
- Configuration metadata
- Using the container
- Benefits of dependency injection
- Lab 1: Experimenting with an object assembly
- What is Spring used for?
- Framework evolutions
Introducing the IoC container
- Spring configuration file
- XML schemas and namespaces
- Towards annotations
- BeanFactory and ApplicationContext
- Setting up the application context
Beans declaration
- Example of assembly
- Example of bean declaration
- Beans declaration without XML
- @Configuration annotation
- Lab 2: Implementing Spring
Injection and instantiation of beans
- Injection by setter
- Injection (instanciation) by constructor
- Instantiation by static “factory method”
- Instantiation by “factory bean”
- FactoryBean interface
- Anonymous bean (created on the fly)
- Lazy instantiation
- Lab 3: Beans instanciation and injection
Autowiring
- Autowiring modes
- @Autowired annotation
- Autowiring candidates
- Reducing the number of autowiring candidates
- @Qualify specific
- Lab 4: Experimenting with autowiring
Other injections
- Injecting collections
- @Autowired with collections
- Optional/required dependency
- Other injection annotations
- Lab 5: Collection injection and optional dependency
- Value injection and @Value
- Other sources of values
- Spring Expression Language (SpEL)
- Syntax elements of SpEL
- Lab 6: Value injection and experimenting SpEL
Decomposing configuration
- @Import, @ImportResource
- Other particularities of XML configurations
Beans scope
- “prototype” scope
- Other scopes
- Lab 7: Understanding scopes
Declaring beans with annotation
- Discovery of @Component
- Stereotyped components
- Annotations
- Lab 8: Beans declaration with annotation
Environment profiles
- Environment profiles: creation
- Environment profiles: activation
- @Conditional annotation
- Lab 9: Using environment profiles (conditional bean)
Beans life cycle
- Beans initialization and destruction
- “init-method” and “destroy-method”
- @PostConstruct and @PreDestroy
- “Aware” interfaces
- BeanPostProcessor interface
- BeanPostProcessor declaration
- Life cycle in summary
- Lab 10: Understanding beans life cycle
Application contexts
- ApplicationContext implementations
- Resources
- Retrieving resources
- Using resources
- Internationalization
- Lab 11: Implementing resources
Application context and events
- Example of an application event
- Lab 12: implementing application events