UML Class Diagrams Sequence Diagrams - PowerPoint PPT Presentation

1 / 23
About This Presentation
Title:

UML Class Diagrams Sequence Diagrams

Description:

UML Class Diagrams. Sequence Diagrams. CS2335. Summer 2002. Agenda. Class Diagrams. Symbology ... Symbology. Class Diagrams. A class diagram shows: Classes ... – PowerPoint PPT presentation

Number of Views:2948
Avg rating:3.0/5.0
Slides: 24
Provided by: Robert9
Category:

less

Transcript and Presenter's Notes

Title: UML Class Diagrams Sequence Diagrams


1
UML Class DiagramsSequence Diagrams
  • CS2335
  • Summer 2002

2
Agenda
  • Class Diagrams
  • Symbology
  • Basic Modeling
  • Intermediate Modeling
  • Sequence Diagrams
  • Symbology

3
Class Diagrams
  • A class diagram shows
  • Classes
  • Attributes
  • Methods
  • Interfaces
  • Collaborations
  • Dependency, Generalization, Relationships
  • A class diagram is a STATIC view of system

4
Basic Class Diagrams
5
Basic Class Diagrams
public protected - private / derived
static
Abstract ltltabstractgtgt
ltltconstructorgtgt ltltquerygtgt ltltupdategtgt
Class Scope Variable
Visibility Attribute Name MultiplicityType
Initial Value Visibility Method Name (Parameter
List) Return-List
6
Basic Class Diagrams
Superclass
Class with parts
Note
Assembly Class
Subclass
Composition (Part-Of)
Association (relationship)
Inheritance (Generalization) (is-a, kind-of)
7
Basic Class Diagram (Example)
takes
8
Basic Class Diagram (Example)
Person
name String - ssn String birthday
Date / age int
getName String -calculateAge int
9
Class Diagrams (Advanced)
Cardinality (Multiplicity) 1 0..1 0..n 1..n

takes
0..n
10
Class Diagrams (Advanced)
Important Stereotypes ltltinterfacegtgt specify
collection of operations to specify
services ltlttypegtgt specify structure and
behavior (not implementation) ltltenumerationgtgt
specify discrete values ltltimplementationClassgtgt
helper class created in detail design
ltltenumerationgtgt Status
Idle Working Error
Fundamental Attributes
readImage writeImage
Fundamental behavior
11
Class Diagrams (Advanced)
Simple Aggregation (object lifetime)
Composite Aggregation (unique member)
Can have self-relations
Exception handling
ltltsendsgtgt
manager
manages
employee
12
Class Diagrams (Advanced)
Association Class
13
Class Diagram Hints
  • Provide abstraction of problem domain
  • Embodies small set of well-defined
    responsibilities
  • Clear separation between specification and
    implementation
  • Understandable and simple
  • Show only important properties

14
Class Hints
  • Organize similar classes into packages
  • Beware of cyclical generalization
  • Use associations where there are structural
    relationships
  • Associations are NOT comm pipes!!!!!!!
  • Start with Analysis, then refine details

15
Bitman Class Diagram
16
Sequence Diagrams
  • AKA Interaction Diagrams Semantically
    equivalent to Collaboration Diagrams
  • Dynamic Model relating use cases and class
    diagrams
  • Shows time ordering of interactions
  • Generally a set of messages between collaborating
    objects
  • Ordering of objects not significant

17
Sequence Diagrams
  • Show only one flow of control
  • May need multiple diagrams
  • Primary
  • Variant
  • Exceptions

18
Sequence Diagram (Basic)
Swimlane
Object Class or Actor
name
Focus of Control/ Activation
message
Object Destruction/ Termination
X
ltltcreategtgt ltltdestroygtgt
19
Sequence Diagram (Basic) Example
aClass Class
Register
adjustRoom
checkRooms
20
Sequence Diagrams (Advanced)
Seq Guard Iteration Return-List
Operation-Name (Argument-List)
Conditional Lifeline
transient
21
Sequence Diagrams (Advanced) Example
ob1 C1
User
run(v)
ltltcreategtgt
xgt0 foo(x)
doit(w)
xlt0 bar(x)
7doit(z)
ltltdestroygtgt
22
Sequence Diagram (Hints)
  • Can show either objects or processes
    (ltltprocessgtgt) in swimlanes
  • Use multiple diagrams to show variations
  • Use advanced features sparingly to keep diagram
    understandable

23
Lab 4 Exercise
Write a Comment
User Comments (0)
About PowerShow.com