Professional Documents
Culture Documents
Uml
Uml
UML Diagrams
Use Case Diagrams
Use Case diagrams & descriptions
Interaction Diagrams
Sequence & collaboration diagrams
State Diagrams
State diagrams & Activity diagrams (not in OMT nor Booch)
Implementation Diagrams
Package, Component & Deployment diagrams
Actor (People)
Use Case
Actor (Systems)
Class name
attribute attribute:primitiveDataType or Class attribute: type or Class=default value method method ( ) method (argument_list):type or Class
Associations
Associations document relations between two or more classes Association name Class A role_A role_B Class B
Order
Contains
Part
lineNumber:int made_up_of
included_in orderNumber:int
Multiplicity of Associations
Multiplicity: refers to how many objects of one class can relate to each object of another class.
Symbols used to indicate multiplicity in associations:
Class Class Class
*
0..1
Exactly one
Class
Zero or more Optional (0 or 1)
1..*
Class Class
1-3,5
* {ordered}
Attributes
Aggregation
Aggregation is a special type of association: a partwhole relationship - a class has an attribute which is an object of another class. Composition is a special case of aggregation where
1. The class is the only one that has objects of that class as attributes 2. This class is the only one that can create or destroy these objects. Composition: Class CD is the Class A CD Aggregation: CD only one with Class CD has MyDate objects, an attribute and the only one * of class Date that can create & Class B Date MyDate destroy them. (Date may appear as attribute of other classes, but not MyDate)
Associations
Association Class: An association that has the properties of a class. Dependency Relationship: Indicates that one of the elements will change when the other changes. It is drawn with a dotted line.
Semester * Takes part Ternary association * Lecture
if grade <=4 then Pass=true
Student *
Result Pass:boolean
Object Diagrams
Objects are also represented in rectangles, their names underlined & written with first letter in small case. Names of objects can be written in 4 ways:
write only the class name preceded by a colon and underlined : Student write the name of specific object with its class oneStudent : Student write only the object name oneStudent: multiple objects : : Student
Object Diagrams
newCD:CD enterDate:Date
Event name Event (number) Notes on whats happening Outside the system Event {constraints} 3 min.
Event Event
Event
object: object:
Event Event Event (message name) Event {constraints} Outside the system
* Course
Student studentName studentID listOfCoursesID transcript:Transcript setStudentName() getStudentName() setStudentID() getStudentID() addToListofCourseIDs() makeTranscript() Transcript studentName studentID listOfCourseNames lilstOfGrades average setStudentName() setStudentID() addCourseName() addGrade() calculateAverage() show()
:Transcript
<<for each Course in listofCourseID of object Student>>
setStudentID( ) setStudentName( ) <<create>> setCourseID( ) getGrade( ) courseName addCourseName( ) courseGrade addGrade ( ) <<destroy>> show ( ) calculateAvg( ) <<destroy>> readCourseGrade readCourseName
:Course
X X
Collaboration Diagram
: Class name
1: Message name
: Class name
2: Message name (parameter list)
State Diagrams
start stop
Initial state A
Event name
State B
Reserved actions: entry: a specific action performed on the entry to the state do: an ongoing action performed while in the state on: a specific action performed as a result of a specific event Exit: a specific action performed on exiting the state
State name State variables
State name
entry:entry-action do:activity-A on event-A: action-B exit: exit-action
OK
Instantiate :OwnerInfo
Activity Diagrams
start stop
Initial activity
Transition
Activity-B
Activity-C Activity-D
Decision
[Option A]
[Option B]
The bar shows that one activity leads to several that occur in parallel or in an unpredictable order.
Implementation Diagrams
Package diagrams: allow developers to show how classes could be divided into modules. (They are logical diagrams) Component diagrams: used to show physical modules that a developer might use. Deployment diagrams: allow developers to model the physical platforms and network connections that will be usaed in their applications.
Package Diagrams
Packages are an organization of the defined classes into groups. They represent logical software modules. They use the same associations as ClassDiagrams (aggregation, association, generalization/specialization, Package A dependency,)
Package B
Package C
1 Server
Fax PC
1