Previous | Table of Contents | Next |
An element is a constituent of a model. As such, it has the capability of owning other elements.
Description
Element has a derived composition association to itself to support the general capability for elements to own other elements.
Generalizations
•
“Element? on page 44
Attributes
No additional attributes
Associations
• / ownedElement: Element[*] The Elements owned by this element. This is a derived union.
• / owner: Element [0..1] The Element that owns this element. This is a derived union.
Constraints
[1] An element may not directly or indirectly own itself.
not self.allOwnedElements()->includes(self)
[2] Elements that must be owned must have an owner.
self.mustBeOwned() implies owner->notEmpty()
Additional Operations
[1] The query allOwnedElements() gives all of the direct and indirect owned elements of an element.
Element::allOwnedElements(): Set(Element);allOwnedElements = ownedElement->union(ownedElement->collect(e | e.allOwnedElements()))
[2] The query mustBeOwned() indicates whether elements of this type must have an owner. Subclasses of Element that do not
require an owner must override this operation.
Element::mustBeOwned() : Boolean;mustBeOwned = true
Semantics
Subclasses of Element will provide semantics appropriate to the concept they represent.
The derived ownedElement association is subsetted (directly or indirectly) by all composed association ends in the metamodel.
Thus ownedElement provides a convenient way to access all the elements that are directly owned by an Element.
Notation
There is no general notation for an Element. The specific subclasses of Element define their own notation.