I have an application that models a tree, with the Tree, Node, and Edge classes (I need the Edge class!), And I'm not sure how to represent the relationships in the class diagram for this. I read other posts about this, but I still doubt it.
The Tree object has a pointer to a Node (its root), which, I believe, defines a one-way relationship (Tree ->Node) with a short 1..1 at both ends. Correctly?
Each Node object has pointers to edges that exit from it (Edge objects). Since these edges only exist if Node exists, I believe this is a compositional association.
But then every Edge object has a pointer to the edge's Node target. How can I imagine this relationship, given that I already have the Edge Node composition ->described above?
Also, if you are still reading :), each Node has a pointer to its parent Node. Here I would use a one-way unary connection, but I do not know what name to use for this relationship.
Thanks for any help.
source
share