Professional Documents
Culture Documents
Object Oriented Analysis and Design Using UML (Part 2) : Use Case Modeling
Object Oriented Analysis and Design Using UML (Part 2) : Use Case Modeling
Object‐Oriented Analysis and
Design using UML (Part 2) Object‐oriented analysis technique where the UML is
fundamentally based from
Use Case Modeling Use Case Model
Use Case Relationships
• Logical model of the system describing the system’s
Creating Use Case Diagrams functional requirements in terms of use cases
Activity Diagrams • Consists of actors and use cases
Class Diagrams
Interaction Diagrams
Generalization/Specialization
(Gen/Spec) Diagrams
Statecharts Diagrams
*Property of STI J0069
*Property of STI J0069
1 _________________________ 2 __________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
Use Case Modeling Use Case Modeling
Actor Use Case
• Can be a human or machine entity that exists outside the • Gives developer a view of what the users want
system • Sequence of transactions performed by a system
• Interacts with the system in a specific way • Produces a measurable result for a particular actor
• Can be divided into two groups: • Describes three things:
o Primary o An actor that initiates an event
o Secondary o The event that triggers a use case
o The use case that performs the actions triggered by the event
• Used to document a single transaction or event
*Property of STI J0069 *Property of STI J0069
Communicates
• Used to connect an actor to a use case
*Property of STI J0069
*Property of STI J0069
5 _________________________ 6 __________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
Use Case Relationships Use Case Relationships
Includes Extends
• Describes the situation in which one use case possesses the
• Describes the situation in which a use case contains behavior behavior that allows the new use case to handle a variation
that is common to more than one use case or exception from the basic use case
*Property of STI J0069 *Property of STI J0069
Generalizes Use Case Diagram
• Type of behavioral diagram defined by UML created
• Implies that one thing is more typical than the other thing from a Use‐case analysis
• Present a graphical overview of the functionality
provided by a system in terms of actors, their goals—
represented as use cases—and any dependencies
between those use cases
• Helpful in exposing requirements and in planning the
project
• Consists of a standard flow of events in the system that
describes a standard system behavior
*Property of STI J0069
*Property of STI J0069
9 _________________________ 10 ________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
Creating Use Case Diagrams Creating Use Case Diagrams
Use Case Diagram Example
Use Case Diagram Guidelines
• Review the business specifications and identify the actors in
the problem domain.
• Identify the high‐level events and develop the primary use
cases that describe those events and how the actors initiate
them.
• Review each primary use case to determine the possible
variations of flow through the use case.
*Property of STI J0069 *Property of STI J0069
• Has no standardized format 1.
2.
User inserts ATM card
ATM reads and validates Bank ID and account number with Bank System
• Includes three sections: 3.
4.
User selects transaction
User selects account
5. User enters PIN number
6. User enters amount to withdraw
o Use case identifiers and initiators 7. ATM updates amount with Bank Accounting System
8. ATM dispenses card, cash and receipt
o Steps performed 9. ATM logs transaction
o Conditions, assumptions, and questions 10. User takes card, cash, and receipt
*Property of STI J0069
*Property of STI J0069
13 ________________________ 14 ________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
Activity Diagrams Activity Diagrams
Also used in analyzing a use case by
Show the conditional logic for the sequence of system
activities needed to accomplish a business process • Describing what actions need to take place and when they
should occur;
Usually created for one use case and may illustrate
• Describing a complicated sequential algorithm; and
several possible scenarios
• Modeling applications with parallel processes
Used in conjunction with other modeling techniques,
such as interaction diagrams and state diagrams
*Property of STI J0069 *Property of STI J0069
*Property of STI J0069
*Property of STI J0069
17 ________________________ 18 ________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
Interaction Diagrams Interaction Diagrams
• Depict the interactions among objects during a particular
period of time
• Can be presented either in a generic form or in an instance Sequence Diagrams
form
• Formats are used for labeling messages:
o The name of the message followed by empty
parentheses: messageName().
o The name of the message followed by parameters in
parentheses: messageName(parameter1, parameter2…).
*Property of STI J0069 *Property of STI J0069
Sequence Diagram Example
• The message name followed by the parameter type, parameter • Student Admission
name, and any default value for the parameter in parentheses:
messageName(parameterType:parameterName(defaultValue).
Parameter types indicate the type of data, such as string,
number, or date.
• The message may be a stereotype, such as <<Create>>,
indicating that a new object is created as a result of the message.
*Property of STI J0069
*Property of STI J0069
21 ________________________ 22 ________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
Interaction Diagrams Interaction Diagrams
Collaboration Diagram Collaboration Diagram Example
• Student Admission
• Describe the relationships and interactions among objects in
the UML
• Represents the roles, functionality, and behavior of individual
objects as well as the overall operation of the system in real
time
• Suited best on simple interactions among relatively small
numbers of objects
*Property of STI J0069 *Property of STI J0069
• Classes are arranged in groups that share common characteristics
• Type of static structure diagram that describes the structure of a
system by illustrating the system’s classes, their attributes, • Classes include class name, attributes, and methods
methods, and the relationships between the classes
• Used to describe the classes of the system and their relationships
to each other
*Property of STI J0069
*Property of STI J0069
25 ________________________ 26 ________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
Class Diagrams Class Diagrams
Data type (such as integer, string, or float) can be
included also on a class diagram Types of Classes
• Entity classes – represent the real‐world items
• Interface classes – provide a means for users to work with
the system
o Human interface
o System interface
• Abstract classes – cannot be directly instantiated
• Control classes – used to control the flow of activities, and
act as coordinator when implementing classes
Methods can be classified into two types:
• Standard
• Custom
*Property of STI J0069 *Property of STI J0069
o Show the relationship between instances of classes
o Denoted as a simple line on a class diagram
o End points of the line are labeled with a symbol that indicates
the multiplicity
• Used to break up a many‐to‐many association between
classes
*Property of STI J0069
*Property of STI J0069
29 ________________________ 30 ________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
Class Diagrams Class Diagrams
Association Example
Whole/Part Relationships
• Described as one class representing the whole object and the
other class representing the parts
• Represented as a line with a diamond on one end that
connects to the classes
*Property of STI J0069 *Property of STI J0069
o Variant of the “has a“ relationship
o Association that represents a whole/part relationship
o Represented as a clear diamond shape on the containing class
end of the line that connects contained class/es to the
containing class
o Can occur when a class is a collection or container of other
classes
*Property of STI J0069
*Property of STI J0069
33 ________________________ 34 ________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
Class Diagrams Generalization/Specialization
(Gen/Spec) Diagrams
• Collection
o Consists of a whole and its members
Generalization
• Composition • Describes the relationship between a general kind of thing
o Stronger variant of the “has a” relationship and is more and a more specific kind of thing
specific than aggregation • Also known as inheritance or “is a” relationship
o Represented as a solid diamond shape on the containing • Used for modeling class inheritance and specialization
class end of the line that connects contained class/es to • Example: an oak is a type of tree
the containing class
Abstract Classes
• General classes and are used when gen/spec is included in
the design
*Property of STI J0069 *Property of STI J0069
*Property of STI J0069
*Property of STI J0069
37 ________________________ 38 ________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
Statechart Diagrams Statechart Diagrams
Event
States
• Occurs at a specific time and place
• Conditions of an object at a particular time • Significant occurrence that triggers a state transition
o Changes in the attributes of an object or in the links an object
• Include a name with each word capitalized
has with other objects
• Its name should be unique and pertinent to the users
• Occurs when a guard condition has been met
• Has entry and exit actions
*Property of STI J0069 *Property of STI J0069
Three categories of events:
Guard Condition
• Something that evaluates to either true or false • Signals or asynchronous messages – occurs when the calling
• Can also be a condition that occurs in a method program does not wait for a message to return, such as a
• Represented in square brackets next to the event label feature run from a menu.
• Temporal events – occur at a predetermined time. These
usually do not include an actor or any external event.
*Property of STI J0069
*Property of STI J0069
41 ________________________ 42 ________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
___________________________ ___________________________
Statechart Diagrams Statechart Diagrams
Example of statechart diagram diagram These diagrams are created only when:
• A class has a complex life cycle.
• An instance of a class may update its attributes in a number
of ways through the life cycle.
• A class has an operational life cycle.
• Two classes depend on each other.
• The object’s current behavior depends on what happened
previously.
*Property of STI J0069 *Property of STI J0069
The two problems that should be avoided in these
diagrams are:
• Check to see if a state does not have all transitions going into
the state, or
• All transitions coming out of the state
*Property of STI J0069
45 ________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________
___________________________