These diagrams and codes are taken from the textbook sections Roles and Navigability.
Given that Man and Woman each contains references to each other, would it be acceptable to add bidirectional arrows to the class diagram? (i.e similar to the ones in the Dog and Man UML.)
Would it also be acceptable to add the roles (e.g. pet and owner) to the Dog and Man UML?
Is it acceptable to use both roles and navigability in a single class diagram? (I do not think they are inter-changeable right?)
Thank you!
class Man {
Woman wife;
}
class Woman {
Man husband;
}
class Dog {
Man man;
// ...
}
class Man {
Dog dog;
// ...
}
Hello, would like to clarify my doubts on this.
These diagrams and codes are taken from the textbook sections
Roles
andNavigability
.Man
andWoman
each contains references to each other, would it be acceptable to add bidirectional arrows to the class diagram? (i.e similar to the ones in theDog
andMan
UML.)pet
andowner
) to theDog
andMan
UML?Thank you!