PicoContainer

# About

- What is PicoContainer?
- Introduction
- Javadoc
- Downloads
- News
- FAQ
- Project Goals
- Support

# Core Concepts

- Component Lifecycle
- Dependency Injection
- Scoped Containers

# Dependency Injection

- Constructor Injection
- Setter Injection
- Annotated Field Injection
- Annotated Method Injection
- Typed Field Injection
- Named Field Injection
- Method Injection
- Multiple Injection
- Composite Injection
- Factory Injection
- Reinjection
- Injection via Providers

# Configuration

- Disambiguation

# Modifying Component Behaviors

- Modifying Behaviors
- Caching and Singletons
- Hiding Implementations
- Thread Safety Behaviors
- AOP Style Interception

# Advanced Concepts

- Fluent Style
- Arrays, Collections and Maps
- Leveraging Parameter Names
- Building Containers
- Component Properties
- Component Configuration
- Monitoring Component Events

# PicoContainer's Architecture

- Design Patterns
- Inversion of Control
- Component Adapters
- Mock Objects
- Terminology
- Container Comparisons
- Transparency

# Container Choices

- DefaultPicoContainer
- CommandLinePicoContainer
- PropertiesPicoContainer
- SystemPropertiesPicoContainer
- TransientPicoContainer
- TieringPicoContainer

# Dependant & Related

- Web Frameworks
- Scripting Support
- Persistence
- Logging

# Anti-patterns

- Propagating Dependency
- Long Constructor Argument List
- Container Dependency
- Unit Tests Use Container
- Singleton

# Help Pages

- Ambiguous Injectable
- Unprocessed Properties

# History

- Inversion of Control History

# Project Info

- Project
- Team

# Hosted by

# Tools

## Dependency Injection

See Martin Fowlers's Inversion of Control Containers and the Dependency Injection patten article from 2003 for a thorough description. Surely everyone has read this by now?

Very quickly: Dependency Injection is where components are given their dependencies through their constructors, methods, or directly into fields. Those components do not get their dependencies themselves, or instantiate them directly. This is very much related to the encompassing design principle Inversion of Control.

## Different types of Dependency Injection supported by PicoContainer

PicoContainer supports multiple ways to specify the injection of dependencies into components. Constructor injection (listed first) is the recomended idiom for PicoContainer. Other types leverage fields and methods. Variations of the method types, can follow a naming convention or be marked with an annotation. Dependencies for those could be populated one by one, or all in one method call. Indeed components could be populated with combinations of Constructor, Method and Field Injection.

Regular Injection Types
Constructor Injection | Where a the constructor of a class is used to pass dependencies into it.
Setter Injection | Multiple Setter methods on the class are used to pass dependencies in.
Annotated Method Injection | Methods are marked with an annotation to indicate that they should be used for injecting dependencies
Field Injection | Fields are injected into for dependencies
Annotated Field Injection | Fields are marked with an annotation to indicate that they should be injected into
Named Field Injection | Fields of a certain name should be injected into
Typed Field Injection | Fields of a certain type should be injected into
Irregular Injection Types
Adapting Injection | Adapting Injection finds which types of injection are pertinant to a component and builds an injector that fits it precisely. This is the default type of injection for DefaultPicoContainer
Multi Injection | Multiple Injection points in order: Constructor, Annotated Methods and then finally Annotated Fields
Composite Injection | As Multi, but an open list of Injection types that makes most sense for your components.

### Where Next?

The Modifying Behaviors page outlines the adding of behaviors to components