Previous UML Classes Table of Contents UML Packages Next


7.3.46 RedefinableElement

Kernel


   A redefinable element is an element that, when defined in the context of a classifier, can be redefined more specifically or differently in the context of another classifier that specializes (directly or indirectly) the context classifier.

*Generalizations

   

    NamedElement (from Kernel , Dependencies ) on page 99

*Description

   A redefinable element is a named element that can be redefined in the context of a generalization. RedefinableElement is an abstract metaclass.

*Attributes

   • isLeaf: Boolean Indicates whether it is possible to further specialize a RedefinableElement . If the value is true, then it is not possible to further specialize the RedefinableElement . Default value is false.

*Associations

*Constraints

   [1] At least one of the redefinition contexts of the redefining element must be a specialization of at least one of the redefinition contexts for each redefined element.

   self.redefinedElement->forAll(e | self.isRedefinitionContextValid(e))

   [2] A redefining element must be consistent with each redefined element.

   self.redefinedElement->forAll(re | re.isConsistentWith(self))

*Additional Operations

   [1] The query isConsistentWith() specifies, for any two RedefinableElement s in a context in which redefinition is possible, whether redefinition would be logically consistent. By default, this is false; this operation must be overridden for subclasses of RedefinableElement to define the consistency conditions.

   RedefinableElement ::isConsistentWith(redefinee: RedefinableElement ): Boolean;

   pre: redefinee.isRedefinitionContextValid(self)

   isConsistentWith = false

   [2] The query isRedefinitionContextValid() specifies whether the redefinition contexts of this RedefinableElement are properly related to the redefinition contexts of the specified RedefinableElement to allow this element to redefine the other. By default at least one of the redefinition contexts of this element must be a specialization of at least one of the redefinition contexts of the specified element.

   RedefinableElement ::isRedefinitionContextValid(redefined: RedefinableElement ): Boolean; isRedefinitionContextValid = redefinitionContext->exists(c | c.allParents()->includes(redefined.redefinitionContext))

*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.