6.2 Association Descriptions


Just as each class has a description, each association also needs a description to establish its basis of abstraction in the domain. The description of an association should not merely restate the descriptions of the associated classes, but should describe the domain relationship under study.

Describe each association from the point of view of each participating class in an additional block of descriptions in the class description. Hence, the Publisher class description will contain first a description of the meaning of the class Publisher, then a description of each attribute (name, address, etc.), then each association with other classes.

Each association should include the role name or verb phrase, the name of the target class, and the association name, as you can see here:

Publisher

PRODUCES AND MARKETS 0..* Book [R12]

A publisher is responsible for contracting with an author to produce a book and then handles the work of marketing the book to book customers and retailers.


The description should describe the role name or verb phrase. What does it mean to be a publisher in the context of the books? As always, the description should center on the domain under study, not on the model. Hence a sentence such as "The publisher maintains a linked list of books." is anathema.

The description should also justify the multiplicity so that we may understand why a Publisher can exist without Books but why a Book cannot exist without a Publisher. There is no need to restate the multiplicity in the text. Here is an example:

Every book we sell is produced by some publisher. We do not sell books directly produced by authors. In a few cases an author will sell books directly; in those cases we use the author or the author's company as the publisher.


The description of the association also appears in the description of the other class, in this case the Book:

Book

IS PRODUCED AND MARKETED BY 1Publisher [R12]

A publisher is responsible for contracting with an author to produce a book and then handles the work of marketing the book to customers and retailers.


Depending on your preference, you can write a single association description that is automatically propagated into both classes (our preference); write two descriptions (tends to lead to some stilted and redundant writing); write one description with a reference to it from another class (works well if the reference is a hyperlink); or just write a single description (but then the reader doesn't know whether the one that's missing was intended to have been written).



Executable UML. A Foundation for Model-Driven Architecture
Executable UML: A Foundation for Model-Driven Architecture
ISBN: 0201748045
EAN: 2147483647
Year: 2001
Pages: 161

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