|
||
The basic hyperspace organizational scheme is a simple extension of the Java class hierarchy. As such, it can only capture hierarchical concerns and relationships. Non-hierarchical relationships require the capture of addition information. The experimental Unit Annotations provide a means to define wide-ranging, non-hierearchical relationships. Currently, the universe construction toolkit collects Unit Annotations, but does not process them. In the future, the toolkit is expected to use the annotations to analyze and validate the universe of composition. | ||
Introduction to Unit Annotations | ||
Unit annotations are stylized Java comments that can be easily
accessed by the gather application. Each unit annotation defines an XML element
that describes the associated software unit. Two kinds of XML elements are
captured by unit annotations. Interaction elements, such as
<declare>, extend, and <use>, define the
permissible interactions among composable units. The element specifies
additional dimensions of concern for each unit.
These annotations are largely experimental. For robust program composition, both component name and module name will need flexible namespace management mechanisms. XML namespaces provide a powerful mechanism, and may be sufficient for integrating independently developed subsystems. Unit annotations take the form of a Java comment with a distinctive XML-like prefix ("//<"). The following character, a "gather marker", indicates the lexical handling for this annotation. A "=" gather marker indicates that the XML element is closed after the first non-annotation line. A "+" gather marker indicates that the XML elements should remain open. A "/" gather marker forces the XML element closed. The three basic interaction elements - <declare>, <extend>, and <use> - define the anticipated role each unit. During composition, a named interface should not be extended or used unless there is exactly one definition. In addition, validation could confirm that each interface is extended or used only by compatible units. Other interaction elements describe combination roles. For example, the <define> element indicates an interface that is both <declare>d and <extend>ed. The interaction elements use the name and form attributes to define the symbolic name and form of each software unit. Four forms widely used in Java applications are class, method, field, and ctor. The mode attribute is only used with the <declare> and <extend>elements. This attributes defines the intended composition behavior for the units. The two basic composition modes are fusion and dispatch. Some extended and aggregate composition modes are also supported (e.g. singelton, after, before). The unit annotations from the modApplication module shows a typical set of declaration elements.
Typical extending annotations are
In order to ensure completeness in extension modules, interface uses are also annotated. Typical annotations are:
Future work is expectd to add direct support for the introduction of alternatives. A dispatch mode with the following structure could support the introduction of alternatives. This eliminated the need for explicit dispatch annotations.
Universe definition are added between the declaring annotation and the declaring Java text.
Additional details can be found in the Unit Annotation Reference. |
||
|