-
Key: UML14-227
-
Legacy Issue Number: 6171
-
Status: closed
-
Source: SSA ( Art Culbertson)
-
Summary:
Semantics
The following is stated: "An operation may be redefined in a specialization of the featured classifier. This redefinition may specialize the types of formal parameters or return results, add new preconditions or postconditions, and new raised exceptions, or otherwise refine the specification of the operation." This statement is not correct if the 'isSubstitutable' attribute of the Generalization is true. To achieve substitutability the parameter types must either be invariant or contra-variant (generalized) rather than specialized. Clearly this statement reflects the type safety restrictions of programming languages, but overriding in actual programming languages does not guarantee substitutability. Similarly, the preconditions of the redefined operation in the specialized class can only be weakened (i.e., removed) not strengthened (i.e., added).
Notation
BNF should be used for specifying the syntax of an operation string.
-
Reported: UML 1.5 — Wed, 3 Sep 2003 04:00 GMT
-
Disposition: Resolved — UML 1.4.2
-
Disposition Summary:
see above
-
Updated: Fri, 6 Mar 2015 20:58 GMT