-
Key: UML24-82
-
Legacy Issue Number: 15499
-
Status: closed
-
Source: NASA ( Dr. Maged Elaasar)
-
Summary:
The description for Operation::isConsistentWith(redefinee : RedefinableElement) suggests that parameter direction should be consistent
"A redefining operation is consistent with a redefined operation if it has the same number of formal parameters, the same number of return results, and the type of each formal parameter and return result conforms to the type of the corresponding redefined parameter or return result."
However, the OCL provided does not check that the "direction" of parameters is consistent.
Operation::isConsistentWith(redefinee: RedefinableElement): Boolean;
pre: redefinee.isRedefinitionContextValid(self)
result = redefinee.oclIsKindOf(Operation) and
{1..self.ownedParameter->size()}
let op: Operation = redefinee.oclAsType(Operation) in
self.ownedParameter->size() = op.ownedParameter->size() and
Sequence->
forAll(i | op.ownedParameter->at(1).type.conformsTo(self.ownedParameter->at(1).type)) -
Reported: UML 2.3 — Mon, 13 Sep 2010 04:00 GMT
-
Disposition: Resolved — UML 2.4
-
Disposition Summary:
Clause 9.6.3 currently says “This redefinition may specialize the types of the owned Parameters. . . ” and,
contradicting this, says “In UML, such rules for type conformance are intentionally not specified.”
We do not mandate either covariance or contravariance for parameters in operation definition, explicitly
allowing either. We will require parameter direction, uniqueness and ordering to be the same. We will
require a multiplicity for which one of the following is true:
The same as the redefined parameter
For an in parameter, multiplicity including (wider than) that of the redefined parameter
For an out or return parameter, the redefined parameter’s multiplicity includes (is wider than) that of
the redefining parameter.
This also resolves Issues 17924 and 17612. -
Updated: Fri, 6 Mar 2015 20:58 GMT