Developed for use with ActionScript 3, Flash 9 and Flex 2 projects it provides an inversion of control container for components that support dependency injection.
Feature summary: Support for constructor and setter injection, with setter injection available to public variables, setter accessors, and methods.
Dependency resolution can be performed automatically through reflection or by providing:
a subclass as a type-hint, a key string that a component was registered with, a function reference to return the dependency, a literal value.
Component instances can be cached allowing emulation of singleton access to instances.
The DI library can also detect some forms of cyclic dependency between components.
Support is included for managing instances created outside of the container. Once registered they are available to any component that requests an instance. Additionally registered instances can be populated by setter injection once, every time or never when retrieved from the container.
Runtime container configuration by XML is available, with additional formats easily added.
Components can be registered in any order as they are only resolved when requested from the container. This allows for the loading of multiple external defintions and RSLs to load classes as required.
A Reflection API is included in the DI library to address issues with the flash.utils.describeType function, and provides an API that makes the common use-cases of the DI library quick and easy.