Description
A redefinable element is a named element that can be redefined in the context of a generalization. RedefinableElement is an abstract metaclass.
Attributes
No additional attributes.
Associations
self.redefinedElement->forAll(e | self.isRedefinitionContextValid(e))
self.redefinedElement->forAll(re | re.isConsistentWith(self))
RedefinableElement::isConsistentWith(redefinee: RedefinableElement): Boolean;
pre: redefinee.isRedefinitionContextValid(self)
isConsistentWith = false
RedefinableElement::isRedefinitionContexValid(redefinable: RedefinableElement): Boolean;
isRedefinitionContextValid = self.redefinitionContext->exists(c |
redefinable.redefinitionContext->exists(c | c.allParents()->includes(r))
)
Semantics
A RedefinableElement represents the general ability to be redefined in the context of a generalization relationship. The detailed semantics of redefinition varies for each specialization of RedefinableElement.
A redefinable element is a specification concerning instances of a classifier that is one of the element's redefinition contexts. For a classifier that specializes that more general classifier (directly or indirectly), another element can redefine the element from the general classifier in order to augment, constrain, or override the specification as it applies more specifically to instances of the specializing classifier.
A redefining element must be consistent with the element it redefines, but it can add specific constraints or other details that are particular to instances of the specializing redefinition context that do not contradict invariant constraints in the general context.
A redefinable element may be redefined multiple times. Furthermore, one redefining element may redefine multiple inherited redefinable elements.
Semantic Variation Points
There are various degrees of compatibility between the redefined element and the redefining element, such as name compatibility (the redefining element has the same name as the redefined element), structural compatibility (the client visible properties of the redefined element are also properties of the redefining element), or behavioral compatibility (the redefining element is substitutable for the redefined element). Any kind of compatibility involves a constraint on redefinitions. The particular constraint chosen is a semantic variation point.
Notation
No general notation. See the subclasses of RedefinableElement for the specific notation used.