• Keine Ergebnisse gefunden

Use Case Diagram

N/A
N/A
Protected

Academic year: 2022

Aktie "Use Case Diagram"

Copied!
28
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Object-Oriented Modeling

U C Di

Use Case Diagram

Slides accompanying UML@Classroom Slides accompanying UML@Classroom Version 1.0

Business Informatics Group

Institute of Software Technology and Interactive Systems Vienna University of Technologyy gy

Favoritenstraße 9-11/188-3, 1040 Vienna, Austria

phone: +43 (1) 58801-18804 (secretary), fax: +43 (1) 58801-18896 office@big.tuwien.ac.at, www.big.tuwien.ac.at

(2)

Literature

ƒ The lecture is based on the following book:

UML @ Cl

UML @ Classroom:

An Introduction to Object-Oriented Modeling

Martina Seidl, Marion Scholz, Christian Huemer , , and Gerti Kappel

Springer Publishing, 2015 ISBN 3319127411

ƒ Use Case Diagram

ƒ Structure Modeling

ƒ State Machine Diagram

S Di

ƒ Sequence Diagram

ƒ Activity Diagram

© BIG / TU Wien 3

(3)

Content

ƒ Introduction

ƒ Use cases

ƒ Use cases

ƒ Actors

ƒ Relationships between use cases and actors

ƒ Relationships between use cases

ƒ Relationships between actors

ƒ Description of use cases

ƒ Description of use cases

ƒ Best practices

ƒ Typical errorsyp

ƒ Notation elements

© BIG / TU Wien 3

(4)

Introduction

ƒ The use case is a fundamental concept of many object-oriented development methods

development methods.

ƒ Use case diagrams express the expectations of the customers/stakeholders

ti l f d t il d d i

ƒ essential for a detailed design

ƒ The use case diagram is used during the entire analysis and design process.

ƒ We can use a use case diagram to answer the following questions:

ƒ What is being described? (The system.)

ƒ Who interacts with the system? (The actors )

ƒ Who interacts with the system? (The actors.)

ƒ What can the actors do? (The use cases.)

© BIG / TU Wien 3

(5)

Example: Student Administration System p y

ƒ System

(what is being described?) (what is being described?)

ƒ Student administration system

ƒ Actors

(who interacts with the system?)

ƒ ProfessorProfessor

ƒ Use cases

(what can the actors do?) (what can the actors do?)

ƒ Query student data

ƒ Issue certificate

ƒ Announce exam

© BIG / TU Wien 4

(6)

Use Case

ƒ Describes functionality expected from the system under development.

ƒ Provides tangible benefit for one or more actors that communicate with

ƒ Provides tangible benefit for one or more actors that communicate with this use case.

ƒ Derived from collected customer wishes.

ƒ Set of all use cases describes the functionality that a system shall provide.

ƒ Documents the functionality that a system offers.y y

ƒ Alternative notations:

© BIG / TU Wien 5

(7)

Actor (1/3) ( )

ƒ Actors interact with the system …

ƒ byby usingusing use casesuse cases,

i.e., the actors initiate the execution of use cases.

ƒ by being used by use cases,

i e the actors provide functionality for the execution of use cases i.e., the actors provide functionality for the execution of use cases.

ƒ Actors represent roles that users adopt.

ƒ Specific users can adopt and set aside multiple roles simultaneously.

ƒ Actors are not part of the system, i.e., they are outside of the system boundaries.

ƒ Alternative notations:Alternative notations:

6

(8)

Actor (2/3) ( )

ƒ Usually user data is also administered within the system. This data is modeled within the system in the form of objects and classes

modeled within the system in the form of objects and classes.

ƒ Example: actor Assistant

ƒ The actor Assistant interacts with the system Laboratory A i t by using it

Assignment by using it.

ƒ The class Assistant describes objects representing user data (e.g., name, ssNr, …).

© BIG / TU Wien 7

(9)

Actor (3/3) ( )

ƒ Human

ƒ E gE.g., Student, ProfessorStudent Professor

ƒ Non-human

ƒ E.g., E-Mail Server

ƒ Primary: has the main benefit of the execution of the use case

ƒ Secondary: receives no direct benefit

ƒ Active: initiates the execution of the use caseActive: initiates the execution of the use case

ƒ Passive: provides functionality for the execution of the use case

ƒ Example:

Human Primary

Human Primary

Non-human Primary Active

Primary Active

Human

8

Secondary Passive

Secondary Active

(10)

Relationships between Use Cases and Actors p

ƒ Actors are connected with use cases via solid lines (associations).

ƒ Every actor must communicate with at least one use case

ƒ Every actor must communicate with at least one use case.

ƒ An association is always binary.

ƒ Multiplicities may be specified.

8

9

(11)

Relationships between Use Cases

«inlcude» - Relationship

ƒ The behavior of one use case (included use case) is integrated in the behavior of another use case (base use case)

behavior of another use case (base use case)

Base use case

requires the behavior of the included use case to be able to offer its functionality case to be able to offer its functionality Included use case

may be executed on its own

ƒ Example:

© BIG / TU Wien 10

(12)

Relationships between Use Cases

«extend» - Relationship

ƒ The behavior of one use case (extending use case) may be integrated in the behavior of another use case (base use case) but does not have in the behavior of another use case (base use case) but does not have to.

ƒ Both use cases may also be executed independently of each other.

Base use case

Extending use case

ƒ A decides if B is executed.

ƒ Extension points define at which point the behavior is integrated

Extending use case

ƒ Extension points define at which point the behavior is integrated.

ƒ Conditions define under which circumstances the behavior is integrated.

© BIG / TU Wien 11

(13)

Relationships between Use Cases

«extend» - Relationship: Extension Points

ƒ Extension points are written directly within the use case.

ƒ Specification of multiple extension points is possible

ƒ Specification of multiple extension points is possible.

ƒ Example:

© BIG / TU Wien 12

(14)

Relationships between Use Cases

Generalization of Use Cases

ƒ Use case A generalizes use case B.

ƒ B inherits the behavior of A and may Base use case

ƒ B inherits the behavior of A and may either extend or overwrite it.

ƒ B also inherits all relationships from A.

Base use case Sub use case

ƒ B adopts the basic functionality of A but

decides itself what part of A is executed or changed.

ƒ AA may be labeledmay be labeled {abstract}{abstract}

ƒ Cannot be executed directly

ƒ Only B is executable

E l

ƒ Example:

© BIG / TU Wien 13

(15)

Relationships between Actors

Generalization of Actors

ƒ Actor A inherits from actor B.

ƒ A can communicate with X and Y

ƒ A can communicate with X and Y.

ƒ B can only communicate with Y.

ƒ Multiple inheritance is permitted.

Super-actor Sub-actor

ƒ Abstract actors are possible.

ƒ Example:

ƒ Example:

ProfessorAND Assistantneeded for executing Query student data

ProfessorOR Assistant needed for executing Query student data

© BIG / TU Wien 14

for executing Query student data for executing Query student data

(16)

Description of Use Cases p

ƒ Structured approach

ƒ NameName

ƒ Short description

ƒ Precondition: prerequisite for successful execution

P t diti t t t ft f l ti

ƒ Postcondition: system state after successful execution

ƒ Error situations: errors relevant to the problem domain

ƒ System state on the occurrence of an error

ƒ Actors that communicate with the use case

ƒ Trigger: events which initiate/start the use case

ƒ Standard process: individual steps to be taken p p

ƒ Alternative processes: deviations from the standard process

[A. Cockburn: Writing Effective Use Cases, Addison Wesley, 2000]

[A. Cockburn: Writing Effective Use Cases, Addison Wesley, 2000]

© BIG / TU Wien 15

(17)

Description of Use Cases - Example p p

ƒ Name: Reserve lecture hall

ƒ Short description: An employee reserves a lecture hall at the university for an event.

ƒ Precondition: The employee is authorized to reserve lecture halls.

ƒ Postcondition: A lecture hall is reserved.

ƒ Error situations: There is no free lecture hall.

ƒ System state in the event of an error: The employee has not reserved a lecture hall.

ƒ Actors: Employee

ƒ Trigger: Employee requires a lecture hall.

ƒ Standard process: (1) Employee logs in to the system.

(2) Employee selects the lecture hall.

(3) Employee selects the date.

(4) System confirms that the lecture hall is free.

(5) Employee confirms the reservation.

ƒ Alternative processes: (4’) Lecture hall is not free.

(5’) System proposes an alternative lecture hall.

(6’) Employee selects alternative lecture hall and confirms the reservation.

© BIG / TU Wien 16

(18)

Best Practices

«include»

UML standard Best practice

© BIG / TU Wien 17

(19)

Best Practices

«extend»

UML standard Best practice

© BIG / TU Wien 18

(20)

Best Practices

Identifying Actorsy g

ƒ Who uses the main use cases?

ƒ Who needs support for their daily work?

ƒ Who needs support for their daily work?

ƒ Who is responsible for system administration?

ƒ What are the external devices/(software) systems with which the system must communicate?

ƒ Who is interested in the results of the system?

© BIG / TU Wien 19

(21)

Best Practices

Identifying Use Casesy g

ƒ What are the main tasks that an actor must perform?

ƒ Does an actor want to query or even modify information contained in

ƒ Does an actor want to query or even modify information contained in the system?

ƒ Does an actor want to inform the system about changes in other

t ?

systems?

ƒ Should an actor be informed about unexpected events within the system?y

© BIG / TU Wien 20

(22)

Best Practices

Typical Errors To Avoid (1/5)y ( )

ƒ Use case diagrams do not model processes/workflows!

© BIG / TU Wien 21

(23)

Best Practices

Typical Errors To Avoid (2/5)y ( )

ƒ Actors are not part of the system, hence, they are positioned outside the system boundaries!

the system boundaries!

© BIG / TU Wien 22

(24)

Best Practices

Typical Errors To Avoid (3/5)y ( )

ƒ Use case Issue information needs EITHER one actor

i OR t f ti

Assistant OR one actor Professor for execution

9

© BIG / TU Wien 23

(25)

Best Practices

Typical Errors To Avoid (4/5)y ( )

ƒ Many small use cases that have the same objective may be grouped to form one use case

9 9

© BIG / TU Wien 24

(26)

Best Practices

Typical Errors To Avoid (5/5)y ( )

ƒ The various steps are part of the use cases not separate use cases

ƒ The various steps are part of the use cases, not separate use cases themselves! -> NO functional decomposition

9 9

© BIG / TU Wien 25

(27)

Notation Elements (1/2)

Name Notation Description

( )

System Boundaries between the system

and the users of the systemy

Use case Unit of functionality of the system

A t R l f th f th t

Actor Role of the users of the system

© BIG / TU Wien 40

(28)

Notation Elements (2/2)

Name Notation Description

( )

Association Relationship between use cases and actors

Generalization Inheritance relationship between

Generalization actors or use cases

Extend B extends A: optional use of use

Extend

relationship

B extends A: optional use of use case B by use case A

Include relationship

A includes B: required use of use case B by use case A

© BIG / TU Wien 41

Referenzen

ÄHNLICHE DOKUMENTE

Und es zeigt sich, dass für die Befragten der Kon- takt zur Organisation wichtig bleibt: Hier kann die soziale Entgrenzung positiven Einfluss auf Engagement (r = 0,10) und

Diese oder eine ähnliche Frage muß man sich wohl als Studierender immer mal stellen. Wenn man die Zeichen der Zeit bzw. der demo- kratisch legitimierten Regierung zu

Welche Prozesse spielen sich zwischen Mensch und Maschine ab?. Beschreibt das System aus Sicht des Benutzers

Returning to (6) and (7), auch (or also) in these dialogues does not have any additive meaning, but just serves as a place for the accent.. In this absence of auch or also, the

Alle Displays wurden mit Mediaplayern ausgestattet und über eine Digital Signage Software cloudbasiert vernetzt.. Damit ist europaweit eine zentrale Steuerung aller

All individuals would like to work in the formal labor market with "good" well-paying jobs and fringe benefits, but there are entry barriers that force individuals to

Populated subsystem A subsystem along with a spreadsheet in which each column represents a functional role for the subsystem, each row represents a specific genome, and each

coming to an objective coming to so on produce an objective draws near that most critical through today’s solid encased a major live of a decent arrangement straightforward go