SlideShare une entreprise Scribd logo
1  sur  11
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

Contenu connexe

En vedette (9)

Introduction to SaltStack
Introduction to SaltStackIntroduction to SaltStack
Introduction to SaltStack
 
Tez
TezTez
Tez
 
Cheap HPC
Cheap HPCCheap HPC
Cheap HPC
 
IronRuby
IronRubyIronRuby
IronRuby
 
Space, Galaxies & Blackholes
Space, Galaxies & BlackholesSpace, Galaxies & Blackholes
Space, Galaxies & Blackholes
 
Agile Development Practices - Productivity
Agile Development Practices - ProductivityAgile Development Practices - Productivity
Agile Development Practices - Productivity
 
HTML Parsing With Hpricot
HTML Parsing With HpricotHTML Parsing With Hpricot
HTML Parsing With Hpricot
 
NLP e Chatbots
NLP e ChatbotsNLP e Chatbots
NLP e Chatbots
 
Hacking and Securing iOS Apps : Part 1
Hacking and Securing iOS Apps : Part 1Hacking and Securing iOS Apps : Part 1
Hacking and Securing iOS Apps : Part 1
 

Similaire à PicoContainer

Dependency injection presentation
Dependency injection presentationDependency injection presentation
Dependency injection presentationAhasanul Kalam Akib
 
CDI Best Practices with Real-Life Examples - TUT3287
CDI Best Practices with Real-Life Examples - TUT3287CDI Best Practices with Real-Life Examples - TUT3287
CDI Best Practices with Real-Life Examples - TUT3287Ahmad Gohar
 
corba-151024114450-lva1-app6891.pptx
corba-151024114450-lva1-app6891.pptxcorba-151024114450-lva1-app6891.pptx
corba-151024114450-lva1-app6891.pptxAasimAbdul
 
springtraning-7024840-phpapp01.pdf
springtraning-7024840-phpapp01.pdfspringtraning-7024840-phpapp01.pdf
springtraning-7024840-phpapp01.pdfBruceLee275640
 
Distributed objects & components of corba
Distributed objects & components of corbaDistributed objects & components of corba
Distributed objects & components of corbaMayuresh Wadekar
 
Writing Testable Code in SharePoint
Writing Testable Code in SharePointWriting Testable Code in SharePoint
Writing Testable Code in SharePointTim McCarthy
 
Spring - Part 1 - IoC, Di and Beans
Spring - Part 1 - IoC, Di and Beans Spring - Part 1 - IoC, Di and Beans
Spring - Part 1 - IoC, Di and Beans Hitesh-Java
 
Session 43 - Spring - Part 1 - IoC DI Beans
Session 43 - Spring - Part 1 - IoC DI BeansSession 43 - Spring - Part 1 - IoC DI Beans
Session 43 - Spring - Part 1 - IoC DI BeansPawanMM
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework Serhat Can
 
Spring Framework Presantation Part 1-Core
Spring Framework Presantation Part 1-CoreSpring Framework Presantation Part 1-Core
Spring Framework Presantation Part 1-CoreDonald Lika
 
DIC To The Limit – deSymfonyDay, Barcelona 2014
DIC To The Limit – deSymfonyDay, Barcelona 2014DIC To The Limit – deSymfonyDay, Barcelona 2014
DIC To The Limit – deSymfonyDay, Barcelona 2014Ronny López
 
Alex Thissen "It depends: loving .NET Core dependency injection or not"
Alex Thissen "It depends: loving .NET Core dependency injection or not"Alex Thissen "It depends: loving .NET Core dependency injection or not"
Alex Thissen "It depends: loving .NET Core dependency injection or not"Fwdays
 
It depends: Loving .NET Core dependency injection or not
It depends: Loving .NET Core dependency injection or notIt depends: Loving .NET Core dependency injection or not
It depends: Loving .NET Core dependency injection or notAlex Thissen
 
Introduction to IoC Container
Introduction to IoC ContainerIntroduction to IoC Container
Introduction to IoC ContainerGyuwon Yi
 
Cut your Dependencies with Dependency Injection - .NET User Group Osnabrueck
Cut your Dependencies with Dependency Injection - .NET User Group OsnabrueckCut your Dependencies with Dependency Injection - .NET User Group Osnabrueck
Cut your Dependencies with Dependency Injection - .NET User Group OsnabrueckTheo Jungeblut
 
Facilitating Idiomatic Swift with Objective-C
Facilitating Idiomatic Swift with Objective-CFacilitating Idiomatic Swift with Objective-C
Facilitating Idiomatic Swift with Objective-CAaron Taylor
 
Distributed systems corba remote connection
Distributed systems corba remote connectionDistributed systems corba remote connection
Distributed systems corba remote connectionMohammedAkramMohiudd
 

Similaire à PicoContainer (20)

Dependency injection presentation
Dependency injection presentationDependency injection presentation
Dependency injection presentation
 
Spring framework
Spring frameworkSpring framework
Spring framework
 
CDI Best Practices with Real-Life Examples - TUT3287
CDI Best Practices with Real-Life Examples - TUT3287CDI Best Practices with Real-Life Examples - TUT3287
CDI Best Practices with Real-Life Examples - TUT3287
 
corba-151024114450-lva1-app6891.pptx
corba-151024114450-lva1-app6891.pptxcorba-151024114450-lva1-app6891.pptx
corba-151024114450-lva1-app6891.pptx
 
Corba
CorbaCorba
Corba
 
springtraning-7024840-phpapp01.pdf
springtraning-7024840-phpapp01.pdfspringtraning-7024840-phpapp01.pdf
springtraning-7024840-phpapp01.pdf
 
Distributed objects & components of corba
Distributed objects & components of corbaDistributed objects & components of corba
Distributed objects & components of corba
 
Writing Testable Code in SharePoint
Writing Testable Code in SharePointWriting Testable Code in SharePoint
Writing Testable Code in SharePoint
 
Spring - Part 1 - IoC, Di and Beans
Spring - Part 1 - IoC, Di and Beans Spring - Part 1 - IoC, Di and Beans
Spring - Part 1 - IoC, Di and Beans
 
Session 43 - Spring - Part 1 - IoC DI Beans
Session 43 - Spring - Part 1 - IoC DI BeansSession 43 - Spring - Part 1 - IoC DI Beans
Session 43 - Spring - Part 1 - IoC DI Beans
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
 
Spring Framework Presantation Part 1-Core
Spring Framework Presantation Part 1-CoreSpring Framework Presantation Part 1-Core
Spring Framework Presantation Part 1-Core
 
DIC To The Limit – deSymfonyDay, Barcelona 2014
DIC To The Limit – deSymfonyDay, Barcelona 2014DIC To The Limit – deSymfonyDay, Barcelona 2014
DIC To The Limit – deSymfonyDay, Barcelona 2014
 
Alex Thissen "It depends: loving .NET Core dependency injection or not"
Alex Thissen "It depends: loving .NET Core dependency injection or not"Alex Thissen "It depends: loving .NET Core dependency injection or not"
Alex Thissen "It depends: loving .NET Core dependency injection or not"
 
It depends: Loving .NET Core dependency injection or not
It depends: Loving .NET Core dependency injection or notIt depends: Loving .NET Core dependency injection or not
It depends: Loving .NET Core dependency injection or not
 
Introduction to IoC Container
Introduction to IoC ContainerIntroduction to IoC Container
Introduction to IoC Container
 
Cut your Dependencies with Dependency Injection - .NET User Group Osnabrueck
Cut your Dependencies with Dependency Injection - .NET User Group OsnabrueckCut your Dependencies with Dependency Injection - .NET User Group Osnabrueck
Cut your Dependencies with Dependency Injection - .NET User Group Osnabrueck
 
Facilitating Idiomatic Swift with Objective-C
Facilitating Idiomatic Swift with Objective-CFacilitating Idiomatic Swift with Objective-C
Facilitating Idiomatic Swift with Objective-C
 
Distributed systems corba remote connection
Distributed systems corba remote connectionDistributed systems corba remote connection
Distributed systems corba remote connection
 
Dependency Injection with Apex
Dependency Injection with ApexDependency Injection with Apex
Dependency Injection with Apex
 

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