80 likes | 240 Views
3. Elaboration Iteration 1. 11. Domain Model: Adding Associations. Objectives. Identify a domain model’s associations. Preamble. My view of associations differs from that of the UP. What follows is my current view .
E N D
3. Elaboration Iteration 1 11. Domain Model: Adding Associations
Objectives • Identify a domain model’s associations
Preamble • My view of associations differs from that of the UP. • What follows is my current view. • objectA hasa objectB when objectA has an instance of objectB as an attribute. • An association implies a hasa relation If there is no hasa relation, the association is not noteworthy. • The hasa relation is not symmetric.
Illustration Mandelbrot Set Viewer Viewer ____________ View ________________ Region IterationLimit SpatialResolution ColorResolution ColorMap Iterate Controller ____________ Operation 1 0 1 + * means 0 or more instances + means 1 or more instances 0 multiplicity can be omitted.
Names • Association names are like method names. Intention: objectA verb objectB. Translation: objectA invoke objectB.verb • 2 objects may have many associations . • Flight departs from Airport • Flight lands at Airport
Illustration Mandelbrot Set Viewer View ________________ Region IterationLimit SpatialResolution ColorResolution ColorMap Iterate Viewer ____________ Controller ____________ Operation + displays 1 1 controlled by * means 0 or more instances + means 1 or more instances 0 multiplicity can be omitted.
Attributes • The part of a class’s state describable by primitive types is represented as attributes. • Should a class’s state have any attributes, if there are no primitive types?
Design Questions? • Are View’s items attributes or associations? • Is Iteration limit an attribute of Iterate? • Is SpatialResolution an attribute of Viewer? • Is ColorMap an attribute of Viewer?