UML notation for 'ending' composition

2019-08-04 18:17发布

问题:

Is there a UML notation for how many levels deep a recursion can be? In a simple composition model I have branches that can have branches or leaves.

But a branch can only have a kid-branch and a grandkid branch, after that, It only can have leaves.

Thanks!

回答1:

Not in UML but there is suplement called OCL (Object Constraint Language). Here is specification http://www.lri.fr/~wolff/teach-material/2008-09/IFIPS-VnV/UML2.0OCL-specification.pdf



回答2:

You can always add manually a constraints on the recursive link. This information would be in UML model but not available graphically. You could also add a graphical constraints which in UML should be a pink color.