This description is independent of the
class (i.e., the context) the attribute is in.
You can see in Figure 3.24 that an engine can belong to the structure of a
wheel. Whether or not a specifi c wheel does really have a relationship to an
engine depends on the role it plays. If it is a front wheel of a car, then it has a
relationship to an engine ( Figure 3.26 ). Relationships between roles are called
connectors .
The role is within the context class and is denoted similarly to an object (i.e.,
as a rectangle) except that the name is not underlined and the multiplicity of the
role is in the upper right corner. The rectangle is dashed if the context class references
the role rather than owning it??”association/aggregation versus composition
( Figure 3.26 ).
Note that, on the object level, we can also state the role name. The object is
written as follows ( Figure 3.28 ):
object name / role name : Type name
FIGURE 3-28
Wheel objects.
class Wheel objects
frontright/front:Wheel rearright/rear:Wheel
frontleft/front:Wheel rearleft/rear:Wheel
FIGURE 3-27
Desirable object model ???car??? (section).
Pages:
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338