ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
PicoContainer
   Rafael Souza
What is PicoContainer?


    Is a embeddable Inversion of Control (IoC)
container for components honor the Dependency
                Injection pattern.
Features
• Lifecycle

• Scoped Containers

• CommandLinePicoContainer

• Caching and Singletons
Design Patterns
• Inversion of Control (IoC).

• Separation of Concerns (SoC)

• Separation of API (or Interface) from Implementation

• Aspect Oriented Programming (AOP)

• Component Oriented Programming (COP)

• Declarative Programming

• Event Based Programming (EBP)
IoC

A key part of what makes
a framework different to a
library
Dependency Injection



Giving an object its instance variables
History
Dependency Injection Types

•   Constructor Injection
•   Setter Injection
•   Annotated Field Injection
•   Annotated Method Injection
•   Typed Field Injection
•   Named Field/Method Injection
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
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
Exemplo

More Related Content

PicoContainer

  • 1. PicoContainer Rafael Souza
  • 2. What is PicoContainer? Is a embeddable Inversion of Control (IoC) container for components honor the Dependency Injection pattern.
  • 3. Features • Lifecycle • Scoped Containers • CommandLinePicoContainer • Caching and Singletons
  • 4. Design Patterns • Inversion of Control (IoC). • Separation of Concerns (SoC) • Separation of API (or Interface) from Implementation • Aspect Oriented Programming (AOP) • Component Oriented Programming (COP) • Declarative Programming • Event Based Programming (EBP)
  • 5. IoC A key part of what makes a framework different to a library
  • 6. Dependency Injection Giving an object its instance variables
  • 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