Previous Table of Contents Next


4.3.2 Core Classes


4.3.2.1 Attribute

   An Attribute describes a named slot within a Classifier that may hold a value.

   Superclasses

   StructuralFeature

   Attributes

   initialValue

An Expression specifying the value of the attribute upon initialization. It is meant to be evaluated at the time the object is initialized. (Note that an explicit constructor may supersede an initial value.)

type:

multiplicity:

Expression
zero or one

4.3.2.2 BooleanExpression

   In the metamodel BooleanExpression defines a statement that will evaluate to an instance of Boolean when it is evaluated.

   Superclasses

   Expression

4.3.2.3 Class

   A class is a description of a set of objects that share the same attributes, operations, methods, relationships, and semantics. A class may use a set of interfaces to specify collections of operations it provides to its environment. In the metamodel, a Class describes a set of objects sharing a collection of Features that are common to the set of objects.

   The purpose of a Class is to declare a collection of Features that fully describe the structure and behavior of objects. Some Classes may not be directly instantiated. These Classes are said to be abstract and exist only for other Classes to inherit and reuse the Features declared by them. No object may be a direct instance of an abstract Class, although an object may be an indirect instance of one through a subclass that is non-abstract.

   A Class acts as the namespace for various kinds of contained elements defined within its scope, including classes, interfaces, and associations (note that this is purely a scoping construction and does not imply anything about aggregation). The contained classes can be used as ordinary classes in the container class. If a class inherits another class, the contents of the ancestor are available to its descendents if the visibility of an element is public or protected. If the visibility is private, then the element is not visible and therefore not available in the descendant.

   Superclasses

   Classifier

4.3.2.4 Classifier Abstract

   A classifier is an element that describes structural and behavioral features; it comes in several specific forms, including class, data type, interface, component, and others that are defined in other metamodel packages. Classifier is often used as a type.

   In the metamodel a Classifier may declare a collection of Features, such as Attributes, Operations, and Methods. It has a name, which is unique in the Namespace enclosing the Classifier. Classifier is an abstract metaclass.

   Classifier is a child of Namespace. As a Namespace, a Classifier may declare other Classifiers nested in its scope. Nested Classifiers may be accessed by other Classifiers only if the nested Classifiers have adequate visibility. There are no data value or state consequences of nested Classifiers; that is, it is not an aggregation or composition.

   Superclasses

   Namespace

   Contained Elements

   Feature

   isAbstract

An abstract Classifier is not instantiable.

type:

multiplicity:

Boolean
exactly one

   References

   feature

An ordered list of Features owned by the Classifier.

class:

defined by:

multiplicity:

inverse:

Feature
ClassifierFeature::feature
zero or more; ordered
Feature::owner

4.3.2.5 Constraint

   A constraint is a semantic condition or restriction expressed in text.

   In the metamodel a Constraint is a BooleanExpression on an associated ModelElement(s) that must be true for the model to be well formed. This restriction can be stated in natural language, or in different kinds of languages with well defined semantics. Certain Constraints are predefined, others may be user defined. Note that a Constraint is an assertion, not an executable mechanism.

   The specification is written as an expression in a designated constraint language. The language can be specially designed for writing constraints (such as OCL), a programming language, mathematical notation, or natural language. If constraints are to be enforced by a model editor tool, then the tool must understand the syntax and semantics of the constraint language. Because the choice of language is arbitrary, constraints can be used as an extension mechanism.

   The constraint concept allows new semantics to be specified linguistically for a model element. In the metamodel a Constraint directly attached to a ModelElement describes semantic restrictions that this ModelElement must obey.

   Superclasses

   ModelElement

   Attributes

   body

A BooleanExpression that must be true when evaluated for an instance of a system to be well formed. A boolean expression defining the constraint. Expressions are written as strings in a designated language. For the model to be well formed, the expression must always yield a true value when evaluated for instances of the constrained elements at any time when the system is stable; that is, not during the execution of an atomic operation.

type:

multiplicity:

BooleanExpression
exactly one

   References

   constrainedElement

A ModelElement or list of ModelElements affected by the Constraint.

class:

defined by:

multiplicity:

inverse:

ModelElement
ElementConstraint::constrainedElement
zero or more
ModelElement::constraint

   Constraints

   A Constraint cannot be applied to itself. [C-3-1]

4.3.2.6 DataType

   A data type is a type whose values have no identity; that is, they are pure values. Data types include primitive built-in types (such as integer and string) as well as definable enumeration types.

   In the metamodel a DataType defines a special kind of Classifier in which operations are all pure functions; that is, they can return data values but they cannot change data values, because they have no identity. For example, an “add? operation on a number with another number as an argument yields a third number as a result; the target and argument are unchanged.

   A DataType is a special kind of Classifier whose instances are primitive values, not objects. For example, integers and strings are usually treated as primitive values. A primitive value does not have an identity, so two occurrences of the same value cannot be differentiated. Usually, DataTypes are used for specification of the type of an attribute or parameter.

   Superclasses

   Classifier

   Constraints

   A DataType cannot contain any other ModelElements. [C-3-2]

4.3.2.7 Dependency

   A dependency states that the implementation or functioning of one or more elements requires the presence of one or more other elements.

   In the metamodel a Dependency is a directed relationship from a client (or clients) to a supplier (or suppliers) stating that the client is dependent on the supplier; that is, the client element requires the presence and knowledge of the supplier element.

   A dependency specifies that the semantics of a set of model elements requires the presence of another set of model elements. This implies that if the source is somehow modified, the dependents probably must be modified. The reason for the dependency can be specified in several different ways (for example, using natural language or an algorithm) but is often implicit.

   Whenever the supplier element of a dependency changes, the client element is potentially invalidated. After such invalidation, a check should be performed followed by possible changes to the derived client element. Such a check should be performed after which action can be taken to change the derived element to validate it again.

   Superclasses

   ModelElement

   Attributes

   kind

Contains a description of the nature of the dependency relationship between the client and supplier. The list of possible values is open-ended. However, CWM predefines the values “Abstraction? and “Usage.?

type:

multiplicity:

String
zero or one

   References

   client

The element that is affected by the supplier element. In some cases the direction is unimportant and serves only to distinguish the two elements.

class:

defined by:

multiplicity:

inverse:

ModelElement
DependencyClient::client
one or more
ModelElement::clientDependency

   supplier

Inverse of client. Designates the element that is unaffected by a change. In a two-way relationship this would be the more general element. In an undirected situation the choice of client and supplier may be irrelevant.

class:

defined by:

multiplicity:

inverse:

ModelElement
DependencySupplier::supplier
one or more
ModelElement::supplierDependency

4.3.2.8 Element Abstract

   An element is an atomic constituent of a model. In the metamodel, an Element is the top metaclass in the metaclass hierarchy. Element is an abstract metaclass.

4.3.2.9 Expression

   In the metamodel an Expression defines a statement that will evaluate to a (possibly empty) set of instances when executed in a context. An Expression does not modify the environment in which it is evaluated. An expression contains an expression string and the name of an interpretation language with which to evaluate the string.

   Superclasses

   Element

   Attributes

   body

The text of the expression expressed in the given language.

type:

multiplicity:

String
exactly one

   language

Names the language in which the expression body is represented. The interpretation of the expression depends on the language. If the language name is omitted, no interpretation for the expression can be assumed. In general, a language name should be spelled and capitalized exactly as it appears in the document defining the language. For example, use COBOL, not Cobol; use Ada, not ADA; use PostScript, not Postscript.

type:

multiplicity:

Name
zero or one

4.3.2.10 Feature Abstract

   A feature is a property, like attribute or operation that is encapsulated within a Classifier.

   In the metamodel a Feature declares a structural or behavioral characteristic of an instance of a Classifier or of the Classifier itself. Feature is an abstract metaclass.

   Superclasses

   ModelElement

   Attributes

   ownerScope

Specifies whether the Feature appears in every instance of the Classifier or whether it appears only once for the entire Classifier.

type:

multiplicity:

ScopeKind
zero or one

   References

   owner

The Classifier declaring the Feature.

class:

defined by:

multiplicity:

inverse:

Classifier
ClassifierFeature::owner
zero or more
Classifier::feature

4.3.2.11 Model

   A model captures a view of a physical system. It is an abstraction of the physical system, with a certain purpose. The model completely describes those aspects of the physical system that are relevant to the purpose of the model, at the appropriate level of detail.

   In the metamodel Model is a subclass of Package. It contains a containment hierarchy of ModelElements that together describe the physical system. A Model also contains a set of ModelElements that represents the environment of the system.

   Different Models can be defined for the same physical system, where each model represents a view of the physical system defined by its purpose and abstraction level; for example, an analysis model, a design model, an implementation model. Typically different models are complementary and defined from the perspectives (viewpoints) of different system stakeholders.

   Superclasses

   Package

4.3.2.12 ModelElement Abstract

   A model element is an element that is an abstraction drawn from the system being modeled.

   In the metamodel a ModelElement is a named entity in a Model. It is the base for all modeling metaclasses in the CWM. All other modeling metaclasses are either direct or indirect subclasses of ModelElement.

   Superclasses

   Element

   Contained Elements

   TaggedValue

   Attributes

   name

An identifier for the ModelElement within its containing Namespace.

type:

multiplicity:

Name
exactly one

   visibility

Specifies extent of the visibility of the ModelElement within its owning Namespace.

type:

multiplicity:

VisibilityKind
exactly one

   References

   clientDependency

Inverse of client. Designates a set of Dependency in which the ModelElement is a client.

class:

defined by:

multiplicity:

inverse:

Dependency
DependencyClient::clientDependency
zero or more
Dependency::client

   constraint


defined by:

multiplicity:

inverse:

ElementConstraint

zero or more
Constraint::constrainedElement

   importer

References the set of Package instances that import the ModelElement.

class:

defined by:

multiplicity:

inverse:

Package
ImportedElements::importer
zero or more
Package::importedElement

   namespace

Designates the Namespace that contains the ModelElement. Every ModelElement except a root element must belong to exactly one Namespace or else be a composite part of another ModelElement (which is a kind of virtual namespace). The pathname of Namespace or ModelElement names starting from the root package provides a unique designation for every ModelElement. The association attribute visibility specifies the visibility of the element outside its namespace (see ElementOwnership).

class:

defined by:

multiplicity:

inverse:

Namespace
ElementOwnership::namespace
zero or one
Namespace::ownedElement

   taggedValue

References the set of TaggedValue instances that extend the ModelElement.

class:

defined by:

multiplicity:

inverse:

TaggedValue
TaggedElement::taggedValue
zero or more
TaggedValue::modelElement

   Constraints

   Tags associated with a model element (directly via a property list or indirectly via a stereotype) must not clash with any meta attributes associated with the model element. [C-3-3]

   A model element must have at most one tagged value with a given tag name. [C-3-4]

   A stereotype cannot extend itself. [C-3-5]

4.3.2.13 Multiplicity

   In the metamodel a Multiplicity defines a non-empty set of non-negative integers. A set that only contains zero ({0}) is not considered a valid Multiplicity. Every Multiplicity has at least one corresponding String representation.

   Superclasses

   Element

   Contained Elements

   MultiplicityRange

   References

   range

References the set of MultiplicityRange instances that describe the cardinality of the Multiplicity instance.

class:

defined by:

multiplicity:

inverse:

MultiplicityRange
RangeMultiplicity
one or more
MultiplicityRange::multiplicity

4.3.2.14 MultiplicityRange

   In the metamodel a MultiplicityRange defines a range of integers. The upper bound of the range cannot be below the lower bound. The lower bound must be a nonnegative integer. The upper bound must be a nonnegative integer or the special value unlimited, which indicates there is no upper bound on the range.

   Superclasses

   Element

   Attributes

   lower upper

Specifies the positive integer lower bound of the range.

type:

multiplicity:

Integer
exactly one

Specifies the upper bound of the range, which is a positive integer or the special value ’unlimited’ indicating no upper bound is defined.

type:

multiplicity:

UnlimitedInteger
exactly one

   References

   multiplicity

References the Multiplicity instance that owns the MultiplicityRange.

class:

defined by:

multiplicity:

inverse:

Multiplicity
RangeMultiplicity::multiplicity
exactly one
Multiplicity::range

4.3.2.15 Namespace Abstract

   A namespace is a part of a model that contains a set of ModelElements each of whose names designates a unique element within the namespace.

   In the metamodel, a Namespace is a ModelElement that can own other ModelElements, such as Classifiers. The name of each owned ModelElement must be unique within the Namespace. Moreover, each contained ModelElement is owned by at most one Namespace. The concrete subclasses of Namespace may have additional constraints on which kind of elements may be contained.

   Namespace is an abstract metaclass.

   Note that explicit parts of a model element, such as the features of a Classifier, are not modeled as owned elements in a namespace. A namespace is used for unstructured contents such as the contents of a package, or a class declared inside the scope of another class.

   Superclasses

   ModelElement

   Contained Elements

   ModelElement

   References

   ownedElement

A set of ModelElements owned by the Namespace. The ModelElement’s visibility attribute states whether the element is visible outside the namespace.

class:

defined by:

multiplicity:

inverse:

ModelElement
ElementOwnership::ownedElement
zero or more
ModelElement::namespace

4.3.2.16 Package

   A package is a grouping of model elements.

   In the metamodel Package is a subclass of Namespace. A Package contains ModelElements such as Packages and Classifiers. A Package may also contain Constraints and Dependencies between ModelElements of the Package.

   The purpose of the package construct is to provide a general grouping mechanism. In fact, its only semantics is to define a namespace for its contents. The package construct can be used for organizing elements for any purpose; the criteria to use for grouping elements together into one package are not defined.

   A package owns a set of model elements, with the implication that if the package is removed from the model, so are the elements owned by the package. Elements with names, such as classifiers, that are owned by the same package must have unique names within the package, although elements in different packages may have the same name.

   There may be relationships between elements contained in the same package, and between an element in one package and an element in a surrounding package at any level. In other words, elements “see? all the way out through nested levels of packages. Elements in peer packages, however, are encapsulated and are not a priori visible to each other. The same goes for elements in contained packages; that is, packages do not see “inwards.?

   Elements owned by a Package can be made available to other Packages by importing them. Although any ModelElement may be imported by a Package, imported ModelElements are typically other Packages. When an element is imported by a package it extends the namespace of that package. Thus the elements available in a Package consists of its owned and imported ModelElements.

   Superclasses

   Namespace

   References

   importedElement

The namespace defined by the package is extended by model elements imported from other packages.

class:

defined by:

multiplicity:

inverse:

ModelElement
ImportedElements::importedElement
zero or more
ModelElement::importer

4.3.2.17 ProcedureExpression

   In the metamodel ProcedureExpression defines a statement that will result in a change to the values of its environment when it is evaluated.

   Superclasses

   Expression

4.3.2.18 Stereotype

   The stereotype concept provides a way of branding (classifying) model elements so that they behave as if they were instances of new virtual metamodel constructs. These model elements have the same structure (attributes, associations, operations) as similar non-stereotyped model elements of the same kind. The stereotype may specify additional constraints and required tagged values that apply to model elements. In addition, a stereotype may be used to indicate a difference in meaning or usage between two model elements with identical structure.

   In the metamodel the Stereotype metaclass is a subclass of ModelElement. Tagged Values and Constraints attached to a Stereotype apply to all ModelElements branded by that Stereotype.

   A stereotype keeps track of the base class to which it may be applied. The base class is a class in the metamodel (not a user-level modeling element) such as Class, Association, etc. If a model element is branded by an attached stereotype, then the CWM base class of the model element must be the base class specified by the stereotype or one of the subclasses of that base class.

   Superclasses

   ModelElement

   Contained Elements Constraint TaggedValue

   Attributes

   baseClass

Specifies the name of a modeling element to which the stereotype applies, such as Class, Association, Constraint, etc. This is the name of a metaclass; that is, a class from the metamodel itself rather than a user model class.

type:

multiplicity:

Name
exactly one

   References

   extendedElement

Designates the model elements affected by the stereotype. Each one must be a model element of the kind specified by the baseClass attribute.

class:

defined by:

multiplicity:

inverse:

ModelElement
StereotypedElement::extendedElement
zero or more
ModelElement::stereotype

   requiredTag

Specifies a set of TaggedValues, each of which specifies a tag that an element classified by the Stereotype is required to have. The value part indicates the default value for the tagged value, that is, the tagged value that an element will be presumed to have if it is not overridden by an explicit tagged value on the element bearing the stereotype. If the value is unspecified, then the element must explicitly specify a tagged value with the given tag.

class:

defined by:

multiplicity:

inverse:

TaggedValue
StereotypeTaggedValues::requiredTag
zero or more
TaggedValue::stereotype

   stereotypeConstraint


defined by:

multiplicity:

inverse:

StereotypeConstraints::stereotypeConstraint

zero or more
Constraint::constrainedStereotype

   Constraints

   The base class name must be provided. [C-3-6]

4.3.2.19 StructuralFeature Abstract

   A structural feature refers to a static feature of a model element.

   In the metamodel, a StructuralFeature declares a structural aspect of a Classifier that is typed, such as an attribute. For example, it specifies the multiplicity and changeability of the StructuralFeature. StructuralFeature is an abstract metaclass.

   Superclasses

   Feature

   Attributes

   changeability

Specifies whether the value may be modified after the object is created.

type:

multiplicity:

ChangeabilityKind
exactly one

   multiplicity

The possible number of data values for the feature that may be held by an instance. The cardinality of the set of values is an implicit part of the feature. In the common case in which the multiplicity is 1..1, then the feature is a scalar; that is, it holds exactly one value.

type:

multiplicity:

Multiplicity
zero or one

   ordering

Specifies whether the set of instances is ordered. The ordering must be determined and maintained by Operations that add values to the feature. This property is only relevant if the multiplicity is greater than one.

type:

multiplicity:

OrderingKind
zero or one

   targetScope

Specifies whether the targets are ordinary Instances or are Classifiers.

type:

multiplicity:

ScopeKind
zero or one

   References

   type

Designates the Classifier whose instances are values of the feature. It must be a Class, DataType, or Interface.

class:

defined by:

multiplicity:

Classifier
StructuralFeatureType::type
exactly one

4.3.2.20 Subsystem

   A subsystem is a grouping of model elements that represents a behavioral unit in a physical system. A subsystem offers interfaces and has operations.

   In the metamodel, Subsystem is a subclass of both Package and Classifier. As such it may have a set of Features.

   The purpose of the subsystem construct is to provide a grouping mechanism for specifying a behavioral unit of a physical system. Apart from defining a namespace for its contents, a subsystem serves as a specification unit for the behavior of its contained model elements.

   The contents of a subsystem is defined in the same way as for a package, thus it consists of owned elements and imported elements, with unique names within the subsystem.

   Superclasses

   Classifier

   Package

4.3.2.21 TaggedValue

   A tagged value allows information to be attached to any model element in the form of a “tagged value? pair; that is, name = value. The interpretation of tagged value semantics is intentionally beyond the scope of CWM. It must be determined by user or tool conventions. It is expected that tools will define tags to supply information needed for their operations beyond the basic semantics of CWM. Such information could include code generation options, model management information, or user-specified semantics.

   Even though TaggedValues are a simple and straightforward extension technique, their use restricts semantic interchange of metadata to only those tools that share a common understanding of the specific tagged value names.

   Superclasses

   Element

   Attributes

   tag

Contains the name of the TaggedValue. This name determines the semantics that are applicable to the contents of the value attribute.

type:

multiplicity:

Name
exactly one

   value

Contains the current value of the TaggedValue.

type:

multiplicity:

String
exactly one

   References

   modelElement

References the ModelElement to which the TaggedValue pertains.

class:

defined by:

multiplicity:

inverse:

ModelElement
TaggedElement::modelElement
zero or one
ModelElement::taggedValue

   stereotype

References a Stereotype that uses the TaggedValue.

class:

defined by:

multiplicity:

inverse:

Stereotype
StereotypeTaggedValues
zero or one
Stereotype::requiredTag