Reference Jason Roff UML Beginners Guide UML FOR

(Reference: Jason Roff – UML Beginner’s Guide) UML FOR DOMAIN MODELS

CLASSES � Box � Top section is class name � Second section is class attributes (data members) � Third section is class member functions � Notation �+ public access � - private access � # protected access

A UML CLASS DIAGRAM FOR COURSE Course -enrollment. Limit -n. Enrolled. Students -start. Time -end. Time -instructor +get. Instructor() +get. Start. Time() +get. Duration()

ATTRIBUTE FORMAT -enrollment. Limit: Integer = 20 -n. Enrolled. Students: Integer=0 -start. Time: Date -end. Time: Date -instructor: String -meeting. Days[1. . 7]: Integer -/meeting. Hours. Week: float

CLASS RELATIONSHIPS � Show relationships with line and association name. Professor teac hes > Course s Student e tak >

MULTIPLICITY teaches > Professor 1 1. . * Professors teach 1 or more courses. Courses have exactly one professor. Course

ROLES teaches > Professor Instructor 1 Graduate Student Teachin g Assistan t 0. . * 1. . * Course 0. . * grades >

CLASS INSTANCES (OBJECTS) � Objects are differentiated from class with an underline and a class name qualifier Course: Cs 350 -enrollment. Limit = 20 -n. Enrolled. Students = 24 -start. Time : 14: 00 -end. Time: 14: 50 -instructor: Ribler

INHERITANCE (EMPTY ARROW) � Empty arrow points to base class (superclass) from derived class (subclass) Person Student Tutor Professor Teaching Assistant

COMPOSITION AND AGGREGATION Car Class List Class Engine Class Sprite Class Composition is expressed with a filled diamond. Aggregation is expressed with a unfilled diamond.

ACTIVITY DIAGRAMS � Model workflows for use-cases (analysis) � Model object behavior (design)

SYMBOLS Start Symbol End Symbol Name of Action Activity Symbol (contains action name) Decision Points
![GUARDS WITH DECISION POINT [new file] Create File [file already exists] Update File GUARDS WITH DECISION POINT [new file] Create File [file already exists] Update File](http://slidetodoc.com/presentation_image_h/2be65da40a687f8af9f6252c80fa1778/image-13.jpg)
GUARDS WITH DECISION POINT [new file] Create File [file already exists] Update File
![GUARD WITHOUT DECISION POINT Record Data [new file] Create File [file already exists] Update GUARD WITHOUT DECISION POINT Record Data [new file] Create File [file already exists] Update](http://slidetodoc.com/presentation_image_h/2be65da40a687f8af9f6252c80fa1778/image-14.jpg)
GUARD WITHOUT DECISION POINT Record Data [new file] Create File [file already exists] Update File

EVENTS AND TRIGGERS � Indicators that an action has taken place Print(File, Printer) Ready Save. As(Filenam e) Print File Save File Create. New(Filename) Create New File

FORKS � Show concurrency Login Load Classes Load Grades

JOINS Load Grades Load Classes Display Data

SWIM LANES Telephone Operator POS System Database Wrapper Purchase() Display Error Determine Type Load Inventory [failure] Change Inventory Display Error [failure] Store Inventory

SEQUENCE DIAGRAMS � Model interaction between active objects � Consist of two components � Active objects � Interactions between active objects Space. Ship Shoot

“LIFELINES” INDICATE ACTIVE OBJECTS UFO Space. Ship Shoot X X indicates the end of the objects life.

CONDITIONS CAN BE PLACED ON MESSAGES INDICATE ACTIVE OBJECTS UFO Space. Ship [UFO in Range] Issue Warning

MESSAGE ARROWS � Synchronous – Flow is suspended until return from the call. (filled arrow head) � Return – Synchronous message is no longer blocked. � Asynchronous – Non-blocking message. Sender doesn’t wait for reply. � Flat – synchronization is unspecidfied.

CREATING AND DESTROYING OBJECTS Space. Ship Missile <<create>> <<destroys>> X
![SEQUENCE DIAGRAMS USE ROUNDED RECTANGLES TO INDICATE STATE UFO Space. Ship [UFO in Range] SEQUENCE DIAGRAMS USE ROUNDED RECTANGLES TO INDICATE STATE UFO Space. Ship [UFO in Range]](http://slidetodoc.com/presentation_image_h/2be65da40a687f8af9f6252c80fa1778/image-24.jpg)
SEQUENCE DIAGRAMS USE ROUNDED RECTANGLES TO INDICATE STATE UFO Space. Ship [UFO in Range] Issue Warning Under Threat Surrender Taken Prisoner Imprisoned
![BRANCHING UFO Space. Ship [at peace] [in alien war] shoot Asteroid shoot BRANCHING UFO Space. Ship [at peace] [in alien war] shoot Asteroid shoot](http://slidetodoc.com/presentation_image_h/2be65da40a687f8af9f6252c80fa1778/image-25.jpg)
BRANCHING UFO Space. Ship [at peace] [in alien war] shoot Asteroid shoot

USERS CAN BE DRAWN AS STICK FIGURES ATM Login Logged in Prompt for transaction type
- Slides: 26