Modelling Interactions, Lecture notes of Software Engineering

Lecture 9, Part 1: Modelling Interactions

Typology: Lecture notes

2016/2017

Uploaded on 11/07/2017

salman-khizer
salman-khizer 🇵🇰

1 document

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Lecture 9, Part 1:
Modelling Interactions
Jennifer Campbell
CSC340 - Winter 2007
CSC340 University of Toronto 2
Moving Towards Specifications
What functions will the new system
provide?
How will people interact with it?
Describe functions from a user’s perspective
UML Use Cases
Used to show:
the functions to be provided by the system
•which actors will use which functions
CSC340 University of Toronto 3
UML Use Case Diagrams
Capture the relationships between actors
and use cases.
Campaign
Manager
Accountant
Staff contact
[BMF99]
Add a
new client
Change a
client contact
Record
client payment
CSC340 University of Toronto 4
Notation for Use Case Diagrams
Actor
Place book order
Communication
association
System
boundary
Use case
[BMF99]
Customer
CSC340 University of Toronto 5
Use cases and Actors
Use case:
a pattern of behavior that the new system is required
to exhibit
a sequence of related actions performed by an actor
and the system via a dialogue.
Actor:
anything that needs to interact with the system:
a person
a role that different people may play
another (external) system.
CSC340 University of Toronto 6
Example: Staff Management
Add new
staff member
Add new
staff category
Calculate staff
bonuses
Change category
for staff member
Accountant
Change rate
for staff category
Staff
Management
System
pf3
pf4

Partial preview of the text

Download Modelling Interactions and more Lecture notes Software Engineering in PDF only on Docsity!

Lecture 9, Part 1:

Modelling Interactions

Jennifer Campbell

CSC340 - Winter 2007

CSC340 University of Toronto 2

Moving Towards Specifications

• What functions will the new system

provide?

– How will people interact with it?

– Describe functions from a user’s perspective

• UML Use Cases

– Used to show:

  • the functions to be provided by the system
  • which actors will use which functions

CSC340 University of Toronto 3

UML Use Case Diagrams

Capture the relationships between actors

and use cases.

Campaign Manager

Accountant

Staff contact

[BMF99]

Add a new client

Change a client contact

Record client payment

CSC340 University of Toronto 4

Notation for Use Case Diagrams

Actor

Place book order

Communication association

System boundary

Use case

[BMF99]

Customer

Use cases and Actors

• Use case :

  • a pattern of behavior that the new system is required

to exhibit

  • a sequence of related actions performed by an actor

and the system via a dialogue.

• Actor :

  • anything that needs to interact with the system:
    • a person
    • a role that different people may play
    • another (external) system.

Example: Staff Management

Add new staff member

Add new staff category

Calculate staff bonuses

Change category for staff member

Accountant

Change rate for staff category

Staff Management System

CSC340 University of Toronto 7

<>

When one use case adds behaviour to a base case

  • used to model a part of a use case that the user may see as optional system behavior;
  • also models a separate sub-case which is executed conditionally.

Registrar

Distribute info to students

Distribute schedule info to students

<>

CSC340 University of Toronto 8

<>

One use case invokes another (like a procedure call);

  • used to avoid describing the same flow of events several times
  • puts the common behavior in a use case of its own.

Cashier

Check out item

Swipe UPC code

<>

CSC340 University of Toronto 9

Example: Car

Driver Mechanic

<> <>

GasAttendant

<>

<>

<> (^) Fix Car Check Oil Drive

Fill Up

Fix car on the road

Turn On Engine

CSC340 University of Toronto 10

Example: Meeting Scheduler

Provide constraints Edit Withdraw Constraints

Validate User

Schedule meeing

Initiator (^) Participant

<>

<>

<>

Generate Schedule

<>

<>

<>

Identifying Actors

  • Look for:
    • the users who directly use the system
    • also others who need services from the system
  • To find actors that are people/roles ask:
    • Who will be a primary user of the system? (primary actor)
    • Who will need support from the system to do her daily tasks?
    • Who will maintain, administrate, keep the system working? (secondary actor)
    • Who or what has an interest in the results that the system produces?
  • To find actors that are external systems ask:
    • Which hardware devices does the system need?
    • With which other systems does the system need to interact with?

Finding Use Cases

  • For each actor, ask the following questions:
    • Which functions does the actor require from the system?
    • What does the actor need to do?
    • Does the actor need to read, create, destroy, modify, or store some kinds of information in the system?
    • Does the actor have to be notified about events in the system?
    • Does the actor need to notify the system about something?
    • What do those events require in terms of system functionality?
    • Could the actor’s daily work be simplified or made more efficient through new functions provided by the system?

CSC340 University of Toronto 19

Modelling Sequences of Events

• Objects “own” information and behaviour

– Objects don’t “know” about other objects’

information, but can ask for it.

– To carry out business processes, objects

have to collaborate.

  • …by sending messages to one another to invoke

each others’ operations

– Objects can only send messages to one

another if they “know” each other

  • I.e. if there is an association between them.

CSC340 University of Toronto 20

Exercise: Online Order System

• Prepare a sequence diagram for the Assign

Driver use case:

The order clerk requests a list of drivers from the

system. Using the system, he selects a driver

and the system checks the driver’s availability.

This is repeated until a driver has be selected

(until an available driver is found). Then the

order clerk assigns the driver using the system,

and the system notifies the delivery person.

CSC340 University of Toronto 21

References

[Amb03] Ambler, S. W. 2003. The Elements of UML

Style. Cambridge, UK: Cambridge University

Press.

[BMF99] Bennett S., McRobb S., and Farmer R. 1999.

Object-Oriented System Analysis and Design

using UML. Berkshire, UK: McGraw Hill.