August 1999
Intermediate to advanced
224 pages
4h 25m
English
Association classes allow you to add attributes, operations, and other features to associations, as shown in Figure 6-14.
We can see from the diagram that a Person may work for a single Company. We need to keep information about the period of time that each employee works for each Company.
We can do this by adding a dateRange attribute to the association. We could add this attribute to the Person class, but it is really a fact about a Person's relationship to a Company, which will change should the person's employer change.
Figure 6-15 shows another way to represent this information: make Employment ...
Read now
Unlock full access