Pico Containers (Java)

Created on 2022-12-19T15:28:13-06:00

Return to the Index

This card pertains to a resource available on the internet.

This card can also be read via Gemini.

Tiny dependency injection framework. Supposedly was used as the base for the JetBrains IDEA IDEs.

Components are registered to a container. This includes the "interfaces" a component requires to be instantiated or provides to the container.

Components are instanced by asking the container for a specific component.

Behaviors: a container can have "behaviors" added that alter how it responds to requests.

Caching: a.k.a. "singleton mode." Ensures a component is instanced once and the same instance is returned on future creation attempts.

Ambiguous component exception: when the container does not know which dependencies to use to satisfy a request.

Using context to select which components to inject; such as explicit context tags or using reflection magic. Sometimes parameter names are even used.

Required instances are provided to a component's constructor, or by calling a setter, or by directly assigning values to fields.