PicoContainer is an embeddable inversion of control container that implements dependency injection. It allows components to declare their dependencies, which are then automatically injected by the container. PicoContainer supports features like lifecycle management, scoped containers, caching, singletons, and different types of dependency injection including constructor injection, setter injection, and field injection. It is based on design patterns such as inversion of control, separation of concerns, and declarative programming.
8. Dependency Injection Types
• Constructor Injection
• Setter Injection
• Annotated Field Injection
• Annotated Method Injection
• Typed Field Injection
• Named Field/Method Injection
9. Constructor Injection
• Type 3
• As much as possible, to create valid objects at construction
time
• What it means to create a valid object in an obvious place
• You to clearly hide any fields that are immutable by simply not
providing a setter
10. Setter Injection
• Type 2
• If you have a lot of constructor parameters
• If you have multiple ways to construct a valid object
• If you have simple parameters such as strings