You should use arrow heads to indicate the navigability of an association.
Logic
is aware of Minefield
, but Minefield
is not aware of Logic
class Logic{
Minefield minefield;
}
class Minefield{
...
}
class Logic:
def __init__(self, minefield):
self.minefield = minefield
# ...
class Minefield:
# ...
Here is an example of a bidirectional navigability; each class is aware of the other.
Navigability can be shown in class diagrams as well as object diagrams.
According to this object diagram the given Logic
object is associated with and aware of two MineField
objects.
Exercises
What does the navigability given by this diagram mean?
(a)
Explanation: The diagram indicates that Unit
object should know about the Item
object. In the implementation, the Unit
object will hold an Item
object in one of its variables.