Study Cards on association, names, read
The name used is “is authored by.” When you supply a name, it is best to write one that reads from left to right or top down.
When you read an association, always start with “one,” “a,” “an,” or “each” or something similar.
The multiplicity is only read on the target side. We ignore the multiplicity and adornments on the source side.
How do we read this figure?
This reading is a consequence of the equivalence of an association to an attribute.
As an attribute is only the property of an instance, the association end on the target side is also only a property of an instance.
Book → Person: A Book is authored by an ordered set of many Persons in the role of author
When you read in the other direction, you generally will need to change the verb form from active to passive or vice versa.
Person → Book: A Person authors a set of many Books in the roles of myBooks
When we read in the other direction, we used “is authored by,” the passive form.
We also added another bit of notation, the reading direction indicator < or > .
This triangle points in the direction that the association name is intended to be read.
This indicator is useful in making the diagram more understandable.
However, it makes editing the diagram (such as changing the orientation of the association) more difficult as it may require a manual maintaining of the triangle direction.
How do we read this?
However, starting at one class, the role names at the target classes must be unique.
The role names map to the attribute names when they are in the attribute format subject to the restriction that within a class’s namespace we cannot have two attributes with the same name.
It is ok to have blank role names, as the tools will generate some opaque string behind the scenes.
In the figure, the role names myBooks and myEdits must be different (which they are). Similarly, author and editor must be different (which they are).
- Higher grades + faster learning
- Don't study anything twice
- 100% sure, 100% understanding