Suppose you have an excerpt of a larger profile for cars:
Now i want to define some constraints for a Car, say one of those constraints states, that if attrA
is true
, then attrB
must be false
like this using OCL:
Context UML::Core::Class inv:
self
.stereotype
.name='Car'
implies
self.attrA=true
implies
self.attrB=false
My question is: If the Mercedes
stereotype specializes the Car stereotype do I stick to the same constraints, in other words: is the stereotype Car
still applied for classes that have the Mercedes
stereotype applied?
I would suppose that self.stereotype.name='Car'
return false
if the applied stereotype is Mercedes
.
This is interesting because I want to have the same attributes on a Mercedes as on a Car, but i want to change the previously stated constraint.