Next: Configuration Up: XML Loading and Configuration Previous: XML Loading and Configuration

##
Loading

As described in Section 3.1, each module referred to by a `ModuleIdentifier`. In order to load first the ModuleIdentifier must be made available to the system. The `Identifier` directive can be used to this end, as shown in Listing 6. This code assumes that the `AbstractEnumeratedModuleIdentifier` has been used. For further information see the `module.dtd` file in the source, which is heavily documented. Its worth remembering that the `AbstractEnumeratedModuleIdentifier` can contain identifiers for many different modules, so relatively few of these statements are needed. In Cinema-MX the modules are grouped into functional units. The overhead of loading an `ModuleIdentifier` is very low (a few objects for each additional one), so there is not really any problem in loading these, even if the module is not used in the end.

    [language=HTML, caption=The Identifier Directive, label=lst:ident-dir]
    <identifier>
      <enumeration>
        <class>uk.ac.man.bioinf.apps.cinema.utils.CinemaUtilityIdentifier</class>
      </enumeration>
    </identifier>

Having made the `ModuleIdentifier` available, the module itself can be loaded or started from within the XML, using the `load` and `start` directive. The module is referred to by the name returned by the identifier. For example, the code in 7 shows loading and starting of the module that provides the ``status bar'' in Cinema-MX.

    [language=HTML, caption=Loading a Module, label=lst:mod-load]
    <load>
      <name>CINEMA_STATUS</name>
    </load>
    <start>
      <name>CINEMA_STATUS</name>
    </start>

Next: Configuration Up: XML Loading and Configuration Previous: XML Loading and Configuration