I have an application that models a tree, with classes Tree, Node and Edge (I need the Edge class!), and I'm not sure how to represent the relationships in the class diagram for this. I've read other posts about this, but am still in doubt.
The Tree object have a pointer to a Node (its root), which I believe defines an one-way association (Tree ->
Node) with multiplicity 1..1 in both ends. Is it right?
Each Node object have pointers to the edges that comes out of it (Edge objects). Since these edges only exist if the node exist, I believe it's a composition association.
But then I have, in each Edge object, a pointer to the target Node of the edge. How can I represent this relationship, considering I already have the Node ->
Edge composition described above?
Also, if you're still reading :), each Node have a pointer to its parent Node. Here, I would use an one-way unary association, but I don't know which name to use for this relationship.
Thanks for any help.