The definition of components is independent of the format in which these are configured.
Many different configuration sources can thus be available, all of which are actually suppliers of component definitions.
Currently however, the primary format of configuration in AgE are XML files.
Xml Configuration
The syntax of the xml configuration files is defined in a XSD file, which is located under http://age.iisg.agh.edu.pl/schema/age/age.xsd. Any XML configuration files are first validated against the schema. By convention, all default values for configuration elements should be defined there, not in the provider implementation.
The main assumption in the xml configuration module implementation is that all fancy xml features, which make user life easier, should be reflected in the xml format itself. The component definition representation, however, should be left as simple as possible.
The module is split into two main functional parts: document loaders and document readers, tight together by a configuration loader.
IConfigurationLoader
Configuration loading is defined in the IConfigurationLoader
interface. Its responsability is to load a list of component definitions, from a specified source.
The current default implementation is ConfigurationLoader
. It needs to be given a String path describing the resource to load definition from.
It then delegate to a chain of IDocumentLoader
in order to create a DOM document out of that resource. Then, a DocumentReader
parses the resulting document and returns a list of definitions
IDocumentLoader
This is an interface for loading and preprocessing DOM Documents. It is intended to be used as a chain of decorators. The bottom one actually loads a Document from the specified resource. All the others can then process the Document, each applying some changes (i.e. resolving <include> tags, etc.)
DocumentReader
This class processes all the elements under the Document root, and delegates to some IDefinitionReader
in order to produce a corresponding definition. This class also sets up all the definitions readers to reflect the definitions hierarchy.
IDefinitionReader
This interface represents readers able to create configuration definitions out of DOM elements. There should be one implementation for each definition and element type.