Suppose a class A has a 'has a' relationship with class B that can only be traversed from A to B.
In the class diagram this is shown as an arrow from A to B.
But, do I also have to show one of the following for class A:
- a property of type B (thus using the class name of B as the type)
- a property that represents the id of the related B instance (long,
String)
If so, when would I use a class property and when an id property?