What is IOC?
Spring creates objects, wires them together, configure them, and manage their life cycle
The objects are spring beans
How does IOC work?
Spring manages the flow of the application
Spring decides when to create objects, how to wire up dependencies, and when to destroy them
What is a dependency
Objects needed for a class to function
Why use dependency injection?
Promotes loose coupling, testability, and flexibility
Adfantages of IOC and DI
Reduced coupling
Improfed testability
Modular and resuable
Flexible and maintainable
Types of DI
Constructor injection (recommended)
Field injection
Setter injection