Class Diagram UML Annotations Example http www mathcs

  • Slides: 8
Download presentation
Class Diagram UML Annotations • Example: http: //www. mathcs. gordon. edu/courses/cps 211/ATMExam ple/Class. Diagram.

Class Diagram UML Annotations • Example: http: //www. mathcs. gordon. edu/courses/cps 211/ATMExam ple/Class. Diagram. html • Diamond • Big Open Triangle • Small Arrow • Dotted line • http: //www. uml-diagrams. org/classreference. html

ATM – check Bjork’s design ²Class diagram Annotations ²Diamond attached to the class that

ATM – check Bjork’s design ²Class diagram Annotations ²Diamond attached to the class that contains another class. ²Often read as “has a “ from the diamond side to the non-diamond, and “is part of” from the nondiamond to the diamond. ²Filled diamond means the part cannot exist without the container. If the container is deleted, delete the parts. Chapter 7 Design and implementation 2

ATM – check Bjork’s design – more annotations ²Class diagram Annotations ²Triangle attached to

ATM – check Bjork’s design – more annotations ²Class diagram Annotations ²Triangle attached to the whole in an “is a “ relationship. ²The class not touching the triangle “is a “ the class touching the triangle. ²The class touching the triangle “can be a “ the class not touching the triangle (“but it will not always be one”) Chapter 7 Design and implementation 3

ATM – check Bjork’s design – more annotations ²Class diagram Annotations ²Small arrow ²Two

ATM – check Bjork’s design – more annotations ²Class diagram Annotations ²Small arrow ²Two classes are related, but only one knows the relationship exists ²The class without the arrow knows the one with the arrow exists ²Solid line – the arrow side is contained inside the other side ²Dotted line – just has a weak relationship with (maybe creates it during a method) Chapter 7 Design and implementation 4

ATM – check Bjork’s design – more annotations ²Class diagram Annotations ²Dotted line -

ATM – check Bjork’s design – more annotations ²Class diagram Annotations ²Dotted line - association ²To small arrow – depends on the small arrow side ²Non-arrow side “somehow depends upon” arrow side ²(small arrow side may be an interface) ²Maybe “uses’ , calls, creates, sends, instead of “depends upon” ²To large arrow - realizes (implements or executes) ²Non arrow side implements or executes arrow side Chapter 7 Design and implementation 5

Inventory UML Product. Manager knows Product exists, but Product does not know. PM changes

Inventory UML Product. Manager knows Product exists, but Product does not know. PM changes product Simple Product is a product manager A product manager can be a Simple Product manager

Try one (observer) Subject has an observer (diamond) Observer is part of a subject

Try one (observer) Subject has an observer (diamond) Observer is part of a subject (diamond) Observer is owned by Subject (filled circle) Concrete subject is a subject Concerted subject is the information being observed Concrete Observer is a Observer Concrete observer holds one copy of the subject's state

One More - File Inventory An element has a inventory relationship, which deletes when

One More - File Inventory An element has a inventory relationship, which deletes when the element is gone Elements are part of inventory container, and inventory model and should be deleted when container gone All these files are types of Inventory Items Directory and path are inventory containers Items and containers are inventory elements