- To decouple classes from one another, dependencies should be injected through Constructors and Setters.
- Classes should not configure themselves. IoC uses dependency injection to:
- Configure a class correctlyi from outside the class
- Wire services or components.
- Piecing together all the beans in the Spring Container is called Wiring.
- This can most commonly be don through xml.
- Various BeanFactories and ApplicationContext objects that support wiring include:
- XMLBeanFactory
- ClassPathXMLApplicationContext
- FileSystemXMLApplicationContext
- XMLWebApplicationContext
Tech Tutorial Tips to Train as a Code Cruncher. Extension of the Noble Career Hunter
Sunday, June 2, 2019
Spring Core Containers and Dependency Injection
Java classes should be as independent as possible from each other.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment