UNIVERSAL MODELING LANGUAGE (UML) Grady Booch, Ivar Jacobson, Jim
Rumbaugh Standard method of creating diagrams
and modeling system architectures There are 14 Diagrams Types
7 Diagram Types are “Structural” 7 Diagram Types are “Dynamic”
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
-enrollmentLimit-nEnrolledStudents-startTime-endTime-instructor
+getInstructor()+getStartTime()+getDuration()
ATTRIBUTE FORMAT
-enrollmentLimit:Integer = 20-nEnrolledStudents: Integer=0-startTime: Date-endTime: Date-instructor: String-meetingDays[1..7]: Integer-/meetingHoursWeek:float
CLASS RELATIONSHIPS
Show relationships with line and association name.
Professor
Student
teaches >
takes
>
Course
MULTIPLICITY
Professor Course1 1..*
Professors teach 1 or more courses.Courses have exactly one professor.
teaches >
ROLES
Professor Course1 1..*
teaches >
Instructor
Graduate Student
0..*
0..*Teaching Assistant grades >
CLASS INSTANCES (OBJECTS)
Objects are differentiated from class with an underline and a class name qualifier
Course:Cs350
-enrollmentLimit = 20-nEnrolledStudents = 24-startTime : 14:00-endTime: 14:50-instructor: Ribler
INHERITANCE (EMPTY ARROW)
Empty arrow points to base class (superclass) from derived class (subclass)
Person
Professor
Student Tutor
Teaching Assistant
Car Class
COMPOSITION AND AGGREGATION
Engine Class
Composition is expressed with a filled diamond.Aggregation is expressed with a unfilled diamond.
List Class
Sprite Class
SYMBOLS
Start Symbol
End Symbol
Activity Symbol (contains action name)
Name of Action
Decision Points
EVENTS AND TRIGGERS
Indicators that an action has taken place
Ready
Print File
Save File
Create New File
Print(File, Printer)
SaveAs(Filename)
CreateNew(Filename)
SWIM LANES
TelephoneOperator
POS SystemDatabase Wrapper
Determine Type
Load Inventory
Purchase()
Display Error [failur
e]
Change Inventory
Store Inventory
Display Error [failur
e]
SEQUENCE DIAGRAMS
Model interaction between active objects
Consist of two components Active objects Interactions between active objects
SpaceShip Shoot
CONDITIONS CAN BE PLACED ON MESSAGES INDICATE ACTIVE OBJECTS
SpaceShip UFO
Issue Warning[UFO in Range]
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 unspecified.
SEQUENCE DIAGRAMS USE ROUNDED RECTANGLES TO INDICATE STATE
SpaceShip UFO
Issue Warning[UFO in Range]
Under Threat
Surrender
Taken Prisoner
Imprisoned
Top Related