Legacy Issue Number: 15500
Source: NASA ( Maged Elaasar)
The operation RedefinableElement::isConsistentWith(redefinee : RedefinableElement) has the documentation:
"The query isConsistentWith() specifies, for any two RedefinableElements in a context in which redefinition is possible, whether redefinition would be logically consistent. By default, this is false"
It is not clear from this description above whether the parameter "redefinee" is the redefining or the redefined element.
A look at some of the overrides of this operation like Property::isConsistentwith(redefinee : RedefinableElement):
" A redefining property is consistent with a redefined property if the type of the redefining property conforms to the type of the redefined property, and the multiplicity of the redefining property (if specified) is contained in the multiplicity of the redefined property. "
The description suggests that the "redefinee" is probably the "redefined" property.
On the other hand, the precondition provided in OCL suggests that "refinee" is definitely the "redefining" property:
since RedefinableElement::isRedefinitionContext(redefined : RedefinableElement) has the description:
"...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."
In summary, this means RedefinableElement has the two operations:
RedefinableElement::isConsistentWith(redefining : RedefinableElement)
RedefinableElement::isRedefinitionContext(redefined : RedefinableElement)
At least "redefinee" should be renamed to "redfining" since this is the term used in the descriptions. However, having the two closely related operations taking opposite parameters make it very confusing and inconsistent.
Reported: UML 2.3 — Mon, 13 Sep 2010 04:00 GMT
Disposition: Resolved — UML 2.4
The issue has identified a serious problem of understanding with the operations that define what consistency
between RedefinableElements means. Does A.isConsistentWith(B) get calculated when A is redefining, or
when A is being redefined? The parameter name “redefinee” seems to imply that it gets calculated when A
is redefining. But this turns out not to be the case. According to constraint redefinition_consistent, it is when A is being redefined. This also applies to the
logic of Property::inConsistentWith and Operation::isConsistentWith (although see also 15499). For all
other definitions of isConsistentWith the direction does not matter. So the logic consistently states that the
parameter is the redefining element. Make this clear by renaming the parameter as redefiningElement.
Now isRedefinitionContextValid is the other way around, as evidenced by the precondition for inConsistentWith:
Make this clearer by naming the parameter redefinedElement.
It would perhaps be better to systematically reverse the sense of one of these operations, but that seems
overly disruptive at this point. The constraint redefinition_context_valid is wrong. It omits the term “self”,
rendering the constraint tautological. All of the constraints in RedefinableElement are too cryptic to be clear.
Updated: Fri, 6 Mar 2015 20:58 GMT