UML Lecture Series - PowerPoint PPT Presentation

1 / 53
About This Presentation
Title:

UML Lecture Series

Description:

Analysis Communication Diagram. The BIG Picture. Round ... UML to Analyse Systems. UML SIG. Slide 53 (of 53) Classes are NOUNS but NOT ALL nouns are classes. ... – PowerPoint PPT presentation

Number of Views:180
Avg rating:3.0/5.0
Slides: 54
Provided by: San5150
Category:
Tags: uml | analyse | lecture | series

less

Transcript and Presenter's Notes

Title: UML Lecture Series


1
UML 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
2
The 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
3
Session 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

4
Keywords 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

5
Class Diagram
Slide 4 (of 24)
6
What Is a Class Diagram?
Professor
- name
- employeeID UniqueId
- hireDate
- status
- discipline
- maxLoad
submitFinalGrade()
acceptCourseOffering()
setMaxLoad()
takeSabbatical() teachClass()
7
Class 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

8
Class 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
9
Guidelines 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
10
What 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
11
What 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..
12
Multiplicity 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
13
Example Multiplicity
1
1
RegisterForCoursesForm
RegistrationController
1
1
0..1
0..1
0..1
1
0..
CourseOffering
Schedule
Student
0..4
0..
14
What 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
15
Example Aggregation
1
1
RegisterForCoursesForm
RegistrationController
1
1
0..1
0..1
0..1
1
0..
CourseOffering
Schedule
Student
0..4
0..
16
Review 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.

17
Example Single Inheritance
  • One class inherits from another.

Ancestor
Account
- balance
Superclass (parent)
- name
- number
withdraw()
createStatement()
Generalization Relationship
Subclasses(children)
Checking
Savings
Descendents
18
Example 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!
19
Analysis 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

20
Identify Classes For a Use Case
  • Depict candidate classes from use case behavior

21
Identify 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

22
Review
  • 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?

23
Interaction Diagram- Sequence Diagram-
Communication Diagram
24
Objects 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.

25
Objects Interact with Messages
  • A message shows how one object asks another
    object to perform some activity.

Message
getCourseOfferings(forSemester)
Car buyer
RegistrationController
CourseCatalogSystem
26
What 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

27
Interaction Diagrams
  • Sequence Diagram
  • Time oriented view of object interaction
  • Communication Diagram
  • Structural view of messaging objects

Communication Diagram
28
What 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
29
Sequence Diagram Contents Objects
SWTSU Catalog
RegisterForCoursesForm
RegistrationController
CourseCatalogSystem
Anonymous Objects
Named Object
Lifelines
30
Sequence Diagram Contents Actor
SWTSU Catalog
RegisterForCoursesForm
RegistrationController
CourseCatalogSystem
Student
Course Catalog
Actor instances
31
Sequence 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
32
Sequence 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
33
What 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
34
Example Communication Diagram
5 displayCourseOfferings( )
6 displayBlankSchedule( )
1 createSchedule( )
Course Catalog
RegisterForCoursesForm
Student
2 getCourseOferings( )
4 getCourseOfferings( )
Registration Controller
Course CatalogSystem
3 getCourseOfferings(forSemester)
35
Communication Diagrams Contents Objects
RegisterForCoursesForm
Objects
SWTSU Catalog CourseCatalogSystem
RegistrationController
36
Communication Diagram Contents Actors
RegisterForCoursesForm
Course Catalog
Student
Actors
SWTSU Catalog CourseCatalogSystem
RegistrationController
37
Communication 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)
38
Sequence 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

39
Sequence 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

40
Review
  • 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?

41
Session 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)
42
Candidate classes identified for use case Process
Order (see Remulak Production case study)
  • Customer
  • Product
  • TransactionOrder

Slide 2 (of 48)
43
Session 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)
44
See Rational Rose model
Slide 2 (of 48)
45
Session 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)
46
See Rational Rose model
Slide 2 (of 48)
47
Session 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)
48
See Rational Rose model
Slide 2 (of 48)
49
Session 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)
50
See Rational Rose model
Slide 2 (of 48)
51
Summary
  • 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

52
Reference
Materials from this session was adapted with
prior permission for academic use from
53
Q A
Write a Comment
User Comments (0)
About PowerShow.com