Associating Classes


You show meaningful relationships between classes with an association. It’s called an association because you are indicating that instances of certain classes associate—that is, communicate with each other—and thus work together. The definition of an association sounds a lot like the definition of a link.

Remember Keep in mind:

  • Links relate objects.

  • Associations relate classes.

  • You give the association a name to help others understand the nature of the relationship between two classes.

Figure 4-2 shows a simple rents association between the Client class and the CrashDummy class. Clients do not purchase or make crash dummies; clients rent crash dummies. So we want to use UML associations to indicate what the instances of these classes do when they get together. The link shown in Figure 4-1 is an instance of the rents association shown in Figure 4-2.

click to expand
Figure 4-2: Two associated classes.

Because a link between two objects carries the same name as the association between the objects’ classes, the link name is often omitted. This is a fancy way of saying, Name your associations, but don’t worry about link names.




UML 2 for Dummies
UML 2 For Dummies
ISBN: 0764526146
EAN: 2147483647
Year: 2006
Pages: 193

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