I want to model a tree, which a situation where a class Node
is composed of multiple instances of itself.
Now how to indicates a constraint like "The root of the tree may contains as many node as needed, but shall only have one instance of this specific type of node" (the special node itself may contain anything
With a diagram a indicated below, we have a conflict between the two composition, I shall be able to add as many specialElement
as a want to a root, because they are treeNodes
.
How could I represent this constraint?