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