Re: Object Constraint Language and Inheritance



I've a problem to express a constraint in OCL. I have already googled
and read in several papers but found no solution which satisfy me.
Perhaps you can help me.
Namely I have an UML class diagram with an inheritance hierarchie. The
root class is RootClass. For another class, say A, I want to express,
that it is not allowed to have subclasses.

The UML1.x "GeneralizableElement" and UML2 "RedefinableElement" both define
a boolean attribute "isLeaf" to express exactly this constraint. Why not
just say A.isLeaf=true.

Jürgen Wüst, SDMetrics.
http://www.sdmetrics.com - UML design quality measurement


.