7.3 Association Implemented Through a Third-Party Class

 <  Free Open Study  >  

As an example of the second method for implementing associations ”using a third-party association class as opposed to a referential attribute ”consider the companies for which a person has worked in the past. This might be the type of information one would find on a person's resume. If this one-to-many association were implemented as a referential attribute, then the attribute would need to be a list. An easier implementation is to create a separate third-party object for each company for which a person has worked (see Figure 7.3). These objects are instantiated from a third-party association class, which usually gets the name of the association as its name . Association classes are typically a collection of referential attributes that refer to the classes involved in the association.

Figure 7.3. Implementing associations through third-party classes.

graphics/07fig03.gif

Again, associations that are not capturing uses relationships always imply that some third party wishes to use the association in an indirect uses relationship. The third party was created due to some distribution of system intelligence requirement in a particular domain.

 <  Free Open Study  >  


Object-Oriented Design Heuristics
Object-Oriented Design Heuristics (paperback)
ISBN: 0321774965
EAN: 2147483647
Year: 1996
Pages: 180

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net