AgE 2.6 : (T) Component Definitions

On this page:

Configuration Object Model

The configuration object model defines components and the dependencies between them. Each component is described by its definition. This description is used by the IoC container to instantiate and initialize components.

Definitions may contain internal ones, thus forming a tree structure in accordance with the Composite design pattern. This solution is used by the container to shadow components and increases the transparency of configuration.

This representation of components is independent from the initial configuration input format. It thus allows many such formats to be developed. It also allows components to be added to the container at runtime, after the initial configuration has been performed. Component definition can also be sent between containers on different nodes, effectively allowing component migrations.

Component Definitions

Each component definition contains:

  • component type, which describes a component class,
  • the name of the component, representing the identifier used to search for a component in the container,
  • a flag indicating whether the component will be represented as an object with a prototype or singleton scope.

and optionally may have:

  • constructor argument definitions
  • property argument definitions

used for the initialization of the component. These arguments may be value types in string format or refer to other components by name.

A fluent interface builder is available to easily create trees of components definitions straight in your code, which is useful for example in tests