问题
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.
来源:https://stackoverflow.com/questions/5259335/uml-notation-for-ending-composition