Title: UML Lecture Series
1UML Lecture Series
- UML to Analyse Systems
- Analysis Class Diagram
- Analysis Sequence Diagram
- Analysis Communication Diagram
Requirements Modeling (Use Case Diagram Use
Case Description)
UML Lecture Series
2The BIG Picture Round Trip Engineering
Business Modeling
Use Case Diagram Use Case Specification
Code Generation
Other Relevant Diagrams
Analysis Class Diagram
Design Class Diagram
Analysis Sequence Diagram
Design Sequence Diagram
3Session Objectives
- At the end of this session You will be able to
- Identify classes based on a use case description.
- Map identified classes to analysis classes.
- Draw a analysis sequence diagram based on
analysis classes and use case description. - Map happy, alternate and exception pathways to
corresponding analysis sequence diagrams. - Generate a analysis communication diagram based
on a analysis sequence diagram
4Keywords used in this session
- association
- aggregation
- multiplicity
- generalisation
- analysis class diagram
- design class diagram
- analysis sequence diagram
- analysis communication diagram
- boundary class/object
- control class/object
- entity class/object
- message
- reflective message
- lifeline
5Class Diagram
Slide 4 (of 24)
6What Is a Class Diagram?
Professor
- name
- employeeID UniqueId
- hireDate
- status
- discipline
- maxLoad
submitFinalGrade()
acceptCourseOffering()
setMaxLoad()
takeSabbatical() teachClass()
7Class Diagram Usage
- When modeling the static view of a system, class
diagrams are typically used in one of three ways,
to model - The vocabulary of a system
- Collaborations
- A logical database schema
8Class Nouns
Classes are NOUNS but NOT ALL nouns are classes.
Example A striker is a football player but NOT
ALL players are strikers.
Hence, it is important to first list out all
nouns and subsequently decide if they are valid
classes
9Guidelines on selection of Classes
1. A class can be instantiated i.e. objects can
be created.
2. A class must embody possible methods and
attributes
10What Is an Association?
- The semantic relationship between two or more
classifiers that specifies connections among
their instances. - A structural relationship specifying that objects
- of one thing are connected to objects of
- another thing.
Course
Student
Schedule
11What Is Multiplicity?
- Multiplicity is the number of instances one class
relates to ONE instance of another class. - For each association, there are two multiplicity
decisions to make, one for each end of the
association. - For each instance of Professor, many Course
Offerings may be taught. - For each instance of Course Offering, there may
be either one or zero Professor as the instructor.
instructor
Professor
CourseOffering
0..1
0..
0..1
0..
12Multiplicity Indicators
Unspecified
Exactly One
1
Zero or More
0..
Zero or More
One or More
1..
Zero or One (optional value)
0..1
Specified Range
2..4
Multiple, Disjoint Ranges
2, 4..6
13Example Multiplicity
1
1
RegisterForCoursesForm
RegistrationController
1
1
0..1
0..1
0..1
1
0..
CourseOffering
Schedule
Student
0..4
0..
14What Is an Aggregation?
- A special form of association that models a
whole-part relationship between the aggregate
(the whole) and its parts. - An aggregation is an is a part-of relationship.
- Multiplicity is represented like other
associations.
1
Part
0..1
15Example Aggregation
1
1
RegisterForCoursesForm
RegistrationController
1
1
0..1
0..1
0..1
1
0..
CourseOffering
Schedule
Student
0..4
0..
16Review What Is Generalization?
- A relationship among classes where one class
shares the structure and/or behavior of one or
more classes. - Defines a hierarchy of abstractions where a
subclass inherits from one or more superclasses. - Single inheritance
- Multiple inheritance
- Is an is a kind of relationship.
17Example Single Inheritance
- One class inherits from another.
Ancestor
Account
- balance
Superclass (parent)
- name
- number
withdraw()
createStatement()
Generalization Relationship
Subclasses(children)
Checking
Savings
Descendents
18Example Multiple Inheritance
- A class can inherit from several other classes.
FlyingThing
Animal
Multiple Inheritance
Horse
Wolf
Bird
Helicopter
Airplane
Use multiple inheritance only when needed and
always with caution!
19Analysis Model
- In Analysis, we analyze and refine the
requirements described in the Use Cases in order
to achieve a more precise view of the
requirements, without being overwhelmed with the
details - Again, the Analysis Model is still focusing on
WHAT were going to do, not HOW were going to do
it (Design Model). But what were going to do is
drawn from the point of view of the developer,
not from the point of view of the customer
20Identify Classes For a Use Case
- Depict candidate classes from use case behavior
21Identify Classes For a Use Case
- Whereas Use Cases are described in the language
of the customer, the Analysis Model is described
in the language of the developer - Three different perspectives are used to identify
candidate classes - Boundary between actors and the system BOUNDARY
CLASS - Information the system uses ENTITY CLASS
- Control logic of the system CONTROL CLASS
22Review
- What does a class diagram represent?
- Define association, aggregation, and
generalization. - How do you find associations?
- What is multiplicity? What information does
multiplicity provide the
modeler?
23Interaction Diagram- Sequence Diagram-
Communication Diagram
24Objects Need to Collaborate
- Objects are useless unless they can collaborate
to solve a problem. - Each object is responsible for its own behavior
and status. - No one object can carry out every responsibility
on its own. - How do objects interact with each other?
- They interact through messages.
25Objects Interact with Messages
- A message shows how one object asks another
object to perform some activity.
Message
getCourseOfferings(forSemester)
Car buyer
RegistrationController
CourseCatalogSystem
26What is an Interaction Diagram?
- Generic term that applies to several diagrams
that emphasize object interactions - Sequence Diagram
- Communication Diagram
- Specialized Variants
- Timing Diagram
- Interaction Overview Diagram
27Interaction Diagrams
- Sequence Diagram
- Time oriented view of object interaction
- Communication Diagram
- Structural view of messaging objects
Communication Diagram
28What Is a Sequence Diagram?
- A sequence diagram is an interaction diagram that
emphasizes the time ordering of messages. - The diagram shows
- The objects participating in the interaction.
- The sequence of messages exchanged.
Sequence Diagram
29Sequence Diagram Contents Objects
SWTSU Catalog
RegisterForCoursesForm
RegistrationController
CourseCatalogSystem
Anonymous Objects
Named Object
Lifelines
30Sequence Diagram Contents Actor
SWTSU Catalog
RegisterForCoursesForm
RegistrationController
CourseCatalogSystem
Student
Course Catalog
Actor instances
31Sequence Diagram Contents Messages
SWTSU Catalog
RegisterForCoursesForm
RegistrationController
CourseCatalogSystem
Course Catalog
Student
1 create schedule( )
2 get course offerings( )
3 get course offerings(for Semester)
4 get course offerings( )
5 display course offerings( )
6 display blank schedule( )
Reflexive Messages
Message
32Sequence Diagram Contents Execution Occurrence
RegisterForCoursesForm
RegistrationController
SWTSU Catalog
CourseCatalogSystem
Student
Course Catalog
1 create schedule( )
2 get course offerings( )
3 get course offerings(for Semester)
4 get course offerings( )
5 display course offerings( )
6 display blank schedule( )
Execution Occurrence
33What Is a Communication Diagram?
- A communication diagram emphasizes the
organization of the objects that participate in
an interaction. - The communication diagram shows
- The objects participating in the interaction.
- Links between the objects.
- Messages passed between the objects.
Communication Diagram
34Example Communication Diagram
5 displayCourseOfferings( )
6 displayBlankSchedule( )
1 createSchedule( )
Course Catalog
RegisterForCoursesForm
Student
2 getCourseOferings( )
4 getCourseOfferings( )
Registration Controller
Course CatalogSystem
3 getCourseOfferings(forSemester)
35Communication Diagrams Contents Objects
RegisterForCoursesForm
Objects
SWTSU Catalog CourseCatalogSystem
RegistrationController
36Communication Diagram Contents Actors
RegisterForCoursesForm
Course Catalog
Student
Actors
SWTSU Catalog CourseCatalogSystem
RegistrationController
37Communication Diagram Contents Links and Messages
Messages
5 displayCourseOfferings( )
6 displayBlankSchedule( )
1 createSchedule( )
Course Catalog
RegisterForCoursesForm
Student
4 getCourseOfferings( )
2 getCourseOferings( )
Registration Controller
Course CatalogSystem
3 getCourseOfferings(forSemester)
38Sequence and Communication Diagram Similarities
- Semantically equivalent
- Can convert one diagram to the other without
losing any information - Model the dynamic aspects of a system
- Model a use-case scenario
39Sequence and Communication Diagram Differences
Communication diagrams
Sequence diagrams
- Show relationships in addition to interactions
- Better for visualizing patterns of communication
- Better for visualizing all of the effects on a
given object - Easier to use for brainstorming sessions
- Show the explicit sequence of messages
- Show execution occurrence
- Better for visualizing overall flow
- Better for real-time specifications and for
complex scenarios
40Review
- What is the purpose of an interaction diagram?
- What is a sequence diagram? A communication
diagram? - What are the similarities between sequence and
communication diagrams? - What are the differences between sequence and
communication diagrams?
41Session Objectives
- At the end of this session You will be able to
- Identify classes based on a use case description.
- Map identified classes to analysis classes.
- Draw a analysis sequence diagram based on
analysis classes and use case description. - Map happy, alternate and exception pathways to
corresponding analysis sequence diagrams. - Generate a analysis communication diagram based
on a analysis sequence diagram
Slide 2 (of 48)
42Candidate classes identified for use case Process
Order (see Remulak Production case study)
- Customer
- Product
- TransactionOrder
Slide 2 (of 48)
43Session Objectives
- At the end of this session You will be able to
- Identify classes based on a use case description.
- Map identified classes to analysis classes.
- Draw a analysis sequence diagram based on
analysis classes and use case description. - Map happy, alternate and exception pathways to
corresponding analysis sequence diagrams. - Generate a analysis communication diagram based
on a analysis sequence diagram
Slide 2 (of 48)
44See Rational Rose model
Slide 2 (of 48)
45Session Objectives
- At the end of this session You will be able to
- Identify classes based on a use case description.
- Map identified classes to analysis classes.
- Draw a analysis sequence diagram based on
analysis classes and use case description. - Map happy, alternate and exception pathways to
corresponding analysis sequence diagrams. - Generate a analysis communication diagram based
on a analysis sequence diagram
Slide 2 (of 48)
46See Rational Rose model
Slide 2 (of 48)
47Session Objectives
- At the end of this session You will be able to
- Identify classes based on a use case description.
- Map identified classes to analysis classes.
- Draw a analysis sequence diagram based on
analysis classes and use case description. - Map happy, alternate and exception pathways to
corresponding analysis sequence diagrams. - Generate a analysis communication diagram based
on a analysis sequence diagram
Slide 2 (of 48)
48See Rational Rose model
Slide 2 (of 48)
49Session Objectives
- At the end of this session You will be able to
- Identify classes based on a use case description.
- Map identified classes to analysis classes.
- Draw a analysis sequence diagram based on
analysis classes and use case description. - Map happy, alternate and exception pathways to
corresponding analysis sequence diagrams. - Generate a analysis communication diagram based
on a analysis sequence diagram
Slide 2 (of 48)
50See Rational Rose model
Slide 2 (of 48)
51Summary
- Identify classes based on a use case description.
- Map identified classes to analysis classes.
- Draw a analysis sequence diagram based on
analysis classes and use case description. - Map happy, alternate and exception pathways to
corresponding analysis sequence diagrams. - Generate a analysis communication diagram based
on a analysis sequence diagram
52Reference
Materials from this session was adapted with
prior permission for academic use from
53Q A