Lec 8 INT Model

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 26

Interaction modeling

Lecture

Ms Sana Arshad
Lecturer in CS, Superior Group of
colleges M B Din
Interaction modeling
 Interaction models shows the interaction
between the components of a system, or
between the system being developed
and other systems (or users).
 Diagrams that are used:
 Use case diagram
 Sequence diagram
Use-case

 The use case technique is used in software and


systems engineering to capture the functional
requirements of a system.
 Represent functionality or services provided by a
system to users.
 It is a description of set of sequence of actions that
a system perform that produces an observable
result.
System Concepts for Use-Case Modeling

Use case – They are stories or scenarios of how people use


the system
◦ Description of system functions from the perspective of external users
in terminology they understand.

Use-case diagram – a diagram that depicts the interactions


between the system and external systems and users.
◦ graphically describes who will use the system and in what ways the
user expects to interact with the system.

Use-case narrative – a textual description of the business


event and how the user will interact with the system to
accomplish the task.
System Concepts for Use-Case Modeling

⚫ Scenario
❑ It is a specific sequence of actions and interactions between
actors and the system. It is also called use case instance
❑ It is one particular story of using a system
▪ E.g. scenario of successfully purchasing items with cash or scenario of
failing to purchase items because of credit payment denial

◦ Use case then is a collection of success and failure scenarios


◦ A UC is a dialogue between an Actor and a system that accomplishes a
task.
Use-Case Diagram
 Use Case Diagram is used to describe the
functionalities provided by a system and the users
associated with that system.
 The Use case diagram is used to identify the
primary elements and processes that form the
system.
 The primary elements are termed as "actors" and
the processes are called "use cases."
 The Use case diagram shows which actors interact
with each use case.
Use-Case Diagram
 The main purpose of the use-case diagram is:

◦ to help development teams visualize the functional


requirements of a system

◦ To help identify relationship of "actors" (human beings


who will interact with the system) with essential
processes

◦ and understand the relationships among different use


cases
Elements of a use-case diagram
 Use-case diagrams contain the following
elements:
• Actors, which represent users of a system,
including human users and other systems.
• Use Cases, which represent functionality or
services provided by a system to users.
Actor
Kinds of Actors
◦ Primary actor has user goals fulfilled through using services of the
System
◦ Supporting actor provides a service (for example, information) to
the System
◦ Offstage actor has an interest in the behavior of the use case
Actor
 Definition:
anyone or anything that needs to interact with the system to
exchange information.
◦ human, organization, another information system,
external device, even time.
◦ An Actor has a unique name and an optional description
 Symbol:

UML notation used to represent an actor


Actor (Example)
 Consider the following scenario related to a
“University Management System” :
◦ In a university management system, a Student can
submit the assignments, the instructor marks
those assignments and then uploads the result.
The Student is allowed to view the Results.
◦ Now, by recalling the definition of actor, can you
identify the actors in this System?
 Student
 Instructor
Actor (Example)
Student Instructor

Student is an external Instructor is another


entity which interacts external entity which
with the system. Student interacts with the
is a user of this system, university management
Student as some services are Instructor system.
used by it.
Use-case
 Use cases describe the interaction between a
primary actor and the system itself
 Each use case describes how the actor will interact
with the system to achieve a specific goal.
 One or more scenarios may be generated from each
use case, corresponding to the detail of each
possible way of achieving that goal.
 Symbol :

UML notation used to represent a use-


case
Use-case (Example)
 Consider the same example again:
◦ In a university management system, a Student can
submit the assignments, the instructor marks those
assignments and then uploads the result. The Student is
allowed to view the Results.
◦ Now, by recalling the definition of use-case, can you
identify the use-cases in this System?

 Submit Assignments
 Mark Assignments
 Upload Results
 View Results
Use-case (Example)
 The use-cases are linked with the functional
requirements of this system. In this example :
◦ Student submit the assignments.
◦ Instructor marks the assignments.
◦ Instructor upload the marks.
◦ Student can view the marks.
 It is now clear that how actors are interacting
with different use-cases of this system.
 Now, lets combine actors and use-cases in one
diagram? Easy ?
Symbols in Use-Case Diagrams

ACTOR

USE-CASE

INTERACTION:
denotes set of messages exchanged among objects

NOTES/COMMENTS
Use-Case Diagram (University Management
System)

SYSTEM
Submit BOUNDARY
Assignments

Mark
Student Assignments

Upload
Results

View Results
Instructor

Package: University Management System


Use Case Scenario
"A patient calls the clinic to make an appointment for a yearly checkup. The
receptionist finds the nearest empty time slot in the appointment book and
schedules the appointment for that time slot. "

Actors are stick figures. Use cases are ovals.


Communications are lines that link actors to use
cases.

A use case is a summary of scenarios for a single task or goal. An actor is


who or what initiates the events involved in that task. Actors are simply roles
that people or objects play. The picture below is a Make Appointment use
case for the medical clinic. The actor is a Patient. The connection between
actor and use case is a communication association (or communication
for short).
Use Case Associations
 Use case association = relationship
between use cases
 Important types:
◦ Include
 A use case uses another use case (functional
decomposition and reuse of existing functionality)
◦ Extends
 A use case extends another use case
◦ Generalization
 A use case has different specializations
≪Include≫: Functional Decomposition

 Problem:
◦ A function in the original problem statement is too complex to be
solvable immediately
 Solution:
◦ Describe the function as the aggregation of a set of simpler
functions. The associated use case is decomposed into smaller use
cases
CreateDocument

≪include≫
≪include≫

Scan Check
≪Include≫: Reuse of Existing Functionality
 Example:
◦ The use case “ViewMap” describes behavior that can be used by the use case
“OpenIncident” (“ViewMap” is factored out)
 Note: The base use case cannot exist alone. It is always called with the supplier
use case

≪include≫

OpenIncident
ViewMap
Base Use ≪include≫
Case Supplier
AllocateResources Use Case
≪Extend≫ Association for Use Cases
 Problem:
◦ The functionality in the original problem statement needs to be extended.
 Solution:
◦ An extend association from Use Case B to Use Case A indicates that B is an
extension of A.
 Example:
◦ The use case “ReportEmergency” is complete by itself , but can be extended by
the use case “Help” for a specific scenario in which the user requires help
 Note: In an extend association, the base use case can be executed without the use
case extension

Base Use
Case B
Help
FieldOfficer
A ≪extend≫

ReportEmergency
Generalization Association in Use Cases
 Problem
◦ You have common behavior among use cases and want to factor this
out.
 Solution
◦ The generalization association among use cases factors out common
behavior. The child use cases inherit the behavior and meaning of the
parent use case and add or override some behavior.
 Example
◦ Consider the use case “ValidateUser”, responsible for verifying the
identity of the user. The customer might require two realizations:
“CheckPassword” and “CheckFingerprint”

CheckPassword

Parent ValidateUser
Child
Case
CheckFingerprint Use Case
Medical clinic diagram, expanded
The following use case diagram expands the original medical clinic diagram with additional features.

A system boundary rectangle


separates the clinic system from the
external actors.

A use case generalization shows that one use


case is simply a special kind of another. Pay Bill
is a parent use case and Bill Insurance is the
child. A child can be substituted for its parent
whenever necessary. Generalization appears as a
line with a triangular arrow head toward the
parent use case.

Include relationships factor use cases into


additional ones. Includes are especially helpful
when the same use case can be factored out of An extend relationship indicates that one use
two different use cases. Both Make Appointment case is a variation of another. Extend notation is
and Request Medication include Check Patient a dotted line, labeled <<extend>>, and with an
Record as a subtask. In the diagram, include arrow toward the base case. The extension
notation is a dotted line beginning at base use point, which determines when the extended
case ending with an arrows pointing to the include case is appropriate, is written inside the base
use case. The dotted line is labeled <<include>>. case.
Class-Exercise
 Read the given case :

◦ Identify the actors


◦ Identify (extract ) the use cases
◦ Construct a proper use-case diagram (with
proper symbols & notations)
Case-Study
 Consider the Library Management System of
SUPERIOR. A Student is allowed to issue books for a
period of two weeks. Student can read
newspapers/magazines in the library and can even
access the databases for e-books. The Library Staff
is responsible for maintaining the records of
students and along with the issued books. The Staff
marks an entry in the register whenever a student
issue or return a book. A fine is charged on a
student if he/she fail to return the book on time.
The Librarian is there to manage the staff, check
the records and prepare reports for DEAN.

You might also like