From Design Patterns by Gamma et al
An object reference representing a part-of or aggregation relationship is indicated by an arrowheaded line with a diamond at the base. The arrow points to the class that is aggregated (e.g., Shape).
An arrowheaded line without the diamond denotes acquaintance (e.g., a LineShape keeps a reference to a Color object, which other shapes may share). A name for the reference may appear near the base to distinguish it from other references
Another useful thing to show is which classes instantiate which others. We use a dashed arrowheaded line to indicate this, since OMT doesn't support it. We call this the "creates" relationship. The arrow points to the class that's instantiated. In Figure c, CreationTool creates LineShape objects.
Is there some design pattern (for example, described in the same book) which makes use of the "creates"/instantiation relationship? I couldn't find it.
Aucun commentaire:
Enregistrer un commentaire