Previous Table of Contents Next


3.3.1 Classes


   Classes are the fundamental building blocks of CWM metamodels. A Class can have three kinds of features: Attributes, References and Operations. They may inherit from other Classes, and may be related to other Classes by Associations.

   The CWM uses the term Class with a meaning that is identical to that of Class in UML. A Class is an abstract specification of meta-objects that includes their state, their interfaces, and (at least informally) behavior. A Class specification is sufficient to allow the generation of concrete interfaces with well defined semantics for managing meta-object state. However, a Class specification does not include any methods to implement meta-object behavior.

   Each Class is defined in terms of its name(s), super-Classes, the Classes whose instances it can contain, its attributes, its references, its operations, its constraints, and whether it is abstract or concrete. This specification uses a hybrid textual and tabular notation to define the important characteristics of each Class. The notation defines defaults for most characteristics, so that the Class definitions need only explicitly specify characteristics that are different from the default.

   The following text explains the notation used for defining Classes and their characteristics.

3.3.1.1 Class Heading

   Each Class is introduced by a section heading. The heading defines the standard ModelElement name for the Class. The Class’s name on the heading line can be followed by the word “abstract? or by a “substitute_name? for some mapping.

3.3.1.2 Superclasses

   This heading lists the Classes that generalize the Class being described. Generalization is another term for inheritance. Multiple inheritance is permitted in CWM.

3.3.1.3 Contained Elements

   If presented, the heading lists the Classes whose instances may be contained by an instance of this container Class. Instances of Classes may act as containers of other elements by means of composite aggregation associations. Only Classes that are in the current metamodel package or in other packages upon which it is dependent are listed in this section. Omission of a Class from this list does not necessarily preclude instances of that Class from being contained by this container Class.

3.3.1.4 Attributes

   This heading lists the Attributes for a Class. Attributes that are inherited from the super-Classes are not listed. If the “Attributes? heading is absent, the Class has no Attributes.

   The following text explains the notation used for defining variable characteristics of Attributes.

type:

multiplicity:

changeable:

derived from:

scope:

This entry defines the base type for the Attribute.
This entry defines the “multiplicity? for the Attribute, consisting of its “lower? and “upper? bounds, and “isOrdered? flag, and an “isUnique? flag. The multiplicity for an Attribute is expressed as follows: (1) The “lower? and “upper? bounds are expressed as “exactly one,? “zero or one,? “zero or more,? and “one or more.? (2) If the word “ordered? appears, “isOrdered? should be true. If it is absent, “isOrdered? should be false. (3) If the word “unique? appears, “isUnique? should be true. If it is absent, “isUnique? should be false.
This optional entry defines the “isChangeable? flag for the Attribute. If omitted, “isChangeable? is true.
This optional entry describes the derivation of a derived Attribute. If the entry is present, the Attribute’s “isDerived? flag will be true. If it is absent, the flag will be false.
This optional entry defines the “scope? of an Attribute as either “instance_level? or “class_level.? If the entry is absent, the Attribute’s “scope? is “instance_level.?

3.3.1.5 References

   This heading lists the References for a Class. References that are inherited from the super-Classes are not listed. If the “References? heading is absent, the Class has no References.

   A Reference connects its containing Class to an AssociationEnd belonging to an Association that involves the Class. This allows a client to navigate directly from an instance of the Class to other instance or instances that are related by links in the Association.

   The following text explains the notation used for defining variable characteristics of References.

class: This entry defines the base type of the Reference. Note the “type? of a Reference must be the same as the “type? of the referenced AssociationEnd.
defined by: This entry defines the Association and AssociationEnd that the Reference is linked to.

multiplicity:

changeable:

inverse:

This entry defines the “multiplicity? for the Reference. These are defined in the same way as Attribute “multiplicity? characteristics, except that “unique? is omitted. Note the “multiplicity? settings for an AssociationEnd and its corresponding Reference(s) must be the same.
This optional entry defines the “isChangeable? flag for the Reference. If omitted, “isChangeable? is true.
This optional entry defines the “inverse? Reference for this Reference. If this entry is absent, the Reference does not have an inverse Reference.

3.3.1.6 Operations

   This heading lists the Operations for a Class. Operations that are inherited from the super-Classes are not listed. If the “Operations? heading is absent, the Class has no Operations.

   The following text explains the notation used for defining variable characteristics of Operations.

return type:

isQuery:

scope:

parameters:

exceptions:

This optional entry defines the “type? and “multiplicity? of the Operations’s return Parameter. If this entry is absent, the Operation does not have a return Parameter.
This optional entry defines the Operation’s “isQuery? flag. If it is absent, “isQuery? has the value false.
This optional entry defines the Operation’s “scope.? If it is absent, the Operation has a “scope? of “instance_level.?
This entry defines the Operation’s non-return Parameter list in the order that they appear in the Operation’s signature. The “name,? “direction,? “type,? and “multiplicity? are defined for each Parameter. If the entry simply says “none,? the Operation has no non-return Parameters.
This optional entry defines the list of Exceptions that this Operation may raise in the order that they appear in the Operation’s signature. If it is absent, the Operation raises no Exception.

3.3.1.7 Constraints

   This heading lists the Constraints that are attached to this Class. If the “Constraints? heading is absent, the Class has no Constraints.