際際滷

際際滷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

Viewers also liked (9)

Introduction to SaltStack
Introduction to SaltStackIntroduction to SaltStack
Introduction to SaltStack
Rafael de Paula Souza
Tez
TezTez
Tez
Rafael de Paula Souza
Cheap HPC
Cheap HPCCheap HPC
Cheap HPC
Alex Moore
IronRuby
IronRubyIronRuby
IronRuby
Alex Moore
Space, Galaxies & Blackholes
Space, Galaxies & BlackholesSpace, Galaxies & Blackholes
Space, Galaxies & Blackholes
Subhransu Behera
Agile Development Practices - Productivity
Agile Development Practices - ProductivityAgile Development Practices - Productivity
Agile Development Practices - Productivity
Alex Moore
HTML Parsing With Hpricot
HTML Parsing With HpricotHTML Parsing With Hpricot
HTML Parsing With Hpricot
Subhransu Behera
NLP e ChatbotsNLP e Chatbots
NLP e Chatbots
Rafael de Paula Souza
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
Subhransu Behera
Space, Galaxies & Blackholes
Space, Galaxies & BlackholesSpace, Galaxies & Blackholes
Space, Galaxies & Blackholes
Subhransu Behera
Agile Development Practices - Productivity
Agile Development Practices - ProductivityAgile Development Practices - Productivity
Agile Development Practices - Productivity
Alex Moore
HTML Parsing With Hpricot
HTML Parsing With HpricotHTML Parsing With Hpricot
HTML Parsing With Hpricot
Subhransu Behera
NLP e ChatbotsNLP e Chatbots
NLP e Chatbots
Rafael de Paula Souza
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
Subhransu Behera

Similar to PicoContainer (20)

Dependency injection presentation
Dependency injection presentationDependency injection presentation
Dependency injection presentation
Ahasanul Kalam Akib
Spring framework
Spring frameworkSpring framework
Spring framework
Sonal Poddar
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
Ahmad Gohar
corba-151024114450-lva1-app6891.pptx
corba-151024114450-lva1-app6891.pptxcorba-151024114450-lva1-app6891.pptx
corba-151024114450-lva1-app6891.pptx
AasimAbdul
Corba
CorbaCorba
Corba
Sanoj Kumar
Spring - a framework written by developers
Spring - a framework written by developersSpring - a framework written by developers
Spring - a framework written by developers
MarcioSoaresPereira1
springtraning-7024840-phpapp01.pdf
springtraning-7024840-phpapp01.pdfspringtraning-7024840-phpapp01.pdf
springtraning-7024840-phpapp01.pdf
BruceLee275640
Distributed objects & components of corba
Distributed objects & components of corbaDistributed objects & components of corba
Distributed objects & components of corba
Mayuresh Wadekar
Writing Testable Code in SharePoint
Writing Testable Code in SharePointWriting Testable Code in SharePoint
Writing Testable Code in SharePoint
Tim 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 Beans
PawanMM
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-Core
Donald 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 2014
Ronny 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 not
Alex Thissen
Introduction to IoC Container
Introduction to IoC ContainerIntroduction to IoC Container
Introduction to IoC Container
Gyuwon 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 Osnabrueck
Theo Jungeblut
Facilitating Idiomatic Swift with Objective-C
Facilitating Idiomatic Swift with Objective-CFacilitating Idiomatic Swift with Objective-C
Facilitating Idiomatic Swift with Objective-C
Aaron Taylor
Distributed systems corba remote connection
Distributed systems corba remote connectionDistributed systems corba remote connection
Distributed systems corba remote connection
MohammedAkramMohiudd
Dependency injection presentation
Dependency injection presentationDependency injection presentation
Dependency injection presentation
Ahasanul Kalam Akib
Spring framework
Spring frameworkSpring framework
Spring framework
Sonal Poddar
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
Ahmad Gohar
corba-151024114450-lva1-app6891.pptx
corba-151024114450-lva1-app6891.pptxcorba-151024114450-lva1-app6891.pptx
corba-151024114450-lva1-app6891.pptx
AasimAbdul
Spring - a framework written by developers
Spring - a framework written by developersSpring - a framework written by developers
Spring - a framework written by developers
MarcioSoaresPereira1
springtraning-7024840-phpapp01.pdf
springtraning-7024840-phpapp01.pdfspringtraning-7024840-phpapp01.pdf
springtraning-7024840-phpapp01.pdf
BruceLee275640
Distributed objects & components of corba
Distributed objects & components of corbaDistributed objects & components of corba
Distributed objects & components of corba
Mayuresh Wadekar
Writing Testable Code in SharePoint
Writing Testable Code in SharePointWriting Testable Code in SharePoint
Writing Testable Code in SharePoint
Tim 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 Beans
PawanMM
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-Core
Donald 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 2014
Ronny 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 not
Alex Thissen
Introduction to IoC Container
Introduction to IoC ContainerIntroduction to IoC Container
Introduction to IoC Container
Gyuwon 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 Osnabrueck
Theo Jungeblut
Facilitating Idiomatic Swift with Objective-C
Facilitating Idiomatic Swift with Objective-CFacilitating Idiomatic Swift with Objective-C
Facilitating Idiomatic Swift with Objective-C
Aaron Taylor
Distributed systems corba remote connection
Distributed systems corba remote connectionDistributed systems corba remote connection
Distributed systems corba remote connection
MohammedAkramMohiudd

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