Problem statement: what do you mean by dependency injection (DI) and inversion of control (IoC)?
- IoC (Inversion of Control): giving control to the container to get instance of an object is called inversion of control, meaning instead i'm creating the object using new operator, let container do that for me.
- DI (Dependency Injection): way of injecting (providing) properties to an object is called DI.
- Types of Dependency Injection
- Constructor Injection
- Setter/Getter Injection - property in xml
- Interface Injection (spring does not support)
No comments:
Post a Comment