Applying UML and Patterns: An Introduction to ObjectOriented Analysis and Design and Iterative Development, Third Edition [Electronic resources]

Craig Larman

نسخه متنی -صفحه : 472/ 217
نمايش فراداده

16.15. Qualified Association

A qualified association has a

qualifier that is used to select an object (or objects) from a larger set of related objects, based upon the qualifier key. Informally, in a software perspective, it suggests looking things up by a key, such as objects in a

HashMap . For example, if a

ProductCatalog contains many

ProductDescriptions , and each one can be selected by an

itemID , then the UML notation in Figure 16.15 can be used to depict this.

Figure 16.15. Qualified associations in the UML.

There's one subtle point about qualified associations: the change in multiplicity. For example, as contrasted in Figure 16.15 (a) vs. (b), qualification reduces the multiplicity at the target end of the association, usually down from many to one, because it implies the selection of usually one instance from a larger set.