Use Case Modeling. Kendall & Kendall© 2005 Pearson Prentice Hall18-2 Commonly Used UML Diagrams The...

23
Use Case Modeling

Transcript of Use Case Modeling. Kendall & Kendall© 2005 Pearson Prentice Hall18-2 Commonly Used UML Diagrams The...

Page 1: Use Case Modeling. Kendall & Kendall© 2005 Pearson Prentice Hall18-2 Commonly Used UML Diagrams The most commonly used UML diagrams are: – Use case diagram,

Use Case Modeling

Page 2: Use Case Modeling. Kendall & Kendall© 2005 Pearson Prentice Hall18-2 Commonly Used UML Diagrams The most commonly used UML diagrams are: – Use case diagram,

Kendall & Kendall © 2005 Pearson Prentice Hall 18-2

Commonly Used UML Diagrams

The most commonly used UML diagrams are:– Use case diagram, describing how the system is

used.• The starting point for UML modeling.

– Use case (not a diagram).– Activity diagram.• Each use case may create one activity diagram.

Page 3: Use Case Modeling. Kendall & Kendall© 2005 Pearson Prentice Hall18-2 Commonly Used UML Diagrams The most commonly used UML diagrams are: – Use case diagram,

Kendall & Kendall © 2005 Pearson Prentice Hall 18-3

Commonly Used UML Diagrams

The most commonly used UML diagrams (continued):

– Sequence diagram, showing the sequence of activities and class relationships.• Each use case may create one or more sequence

diagrams.• A collaboration diagram is an alternative to a sequence

diagram.

Page 4: Use Case Modeling. Kendall & Kendall© 2005 Pearson Prentice Hall18-2 Commonly Used UML Diagrams The most commonly used UML diagrams are: – Use case diagram,

Kendall & Kendall © 2005 Pearson Prentice Hall 18-4

Commonly Used UML Diagrams

The most commonly used UML diagrams (continued):

– Class diagram, showing classes and relationships.• Sequence diagrams and CRC cards are used to

determine classes.

– Statechart diagram.• Each class may create a statechart diagram, useful for

determining class methods.

Page 5: Use Case Modeling. Kendall & Kendall© 2005 Pearson Prentice Hall18-2 Commonly Used UML Diagrams The most commonly used UML diagrams are: – Use case diagram,

Kendall & Kendall © 2005 Pearson Prentice Hall 18-5

Overview of UML Diagrams

Page 6: Use Case Modeling. Kendall & Kendall© 2005 Pearson Prentice Hall18-2 Commonly Used UML Diagrams The most commonly used UML diagrams are: – Use case diagram,

Use Cases

• Depiction of a system’s behavior or functionality under various conditions as the system responds to requests from users

• Full functioning for a specific business purpose

Page 7: Use Case Modeling. Kendall & Kendall© 2005 Pearson Prentice Hall18-2 Commonly Used UML Diagrams The most commonly used UML diagrams are: – Use case diagram,

Kendall & Kendall © 2005 Pearson Prentice Hall 18-7

Use Case Diagram

• A use (yoos) case describes what the system does, not how it does the work.

• The use case model reflects the view of the system of the user outside of the system.

• Symbols are:– Actor, a stick figure.– Use case, an oval.– Connecting lines.

Page 8: Use Case Modeling. Kendall & Kendall© 2005 Pearson Prentice Hall18-2 Commonly Used UML Diagrams The most commonly used UML diagrams are: – Use case diagram,

UML Use Case Diagram Symbols

Use Case

Actor

Boundary

Connection

Include relationship

Extend relationship

<<include>>

<<extend>>

Page 9: Use Case Modeling. Kendall & Kendall© 2005 Pearson Prentice Hall18-2 Commonly Used UML Diagrams The most commonly used UML diagrams are: – Use case diagram,

Kendall & Kendall © 2005 Pearson Prentice Hall 18-9

Actors

• Represent role played by one or more users• Exist outside of the system• May be a person, another system, a device, such as a

keyboard or Web connection• Can initiate an instance of a use case• May interact with one or more use cases and a use

case may involve one or more actors

Page 10: Use Case Modeling. Kendall & Kendall© 2005 Pearson Prentice Hall18-2 Commonly Used UML Diagrams The most commonly used UML diagrams are: – Use case diagram,

Kendall & Kendall © 2005 Pearson Prentice Hall 18-10

Actors (Continued)

• Actors may be divided into two groups:• Primary actors supply data or receive

information from the system• Secondary actors help to keep the system

running or provide help– Help desk, analysts, programmers, etc.

Page 11: Use Case Modeling. Kendall & Kendall© 2005 Pearson Prentice Hall18-2 Commonly Used UML Diagrams The most commonly used UML diagrams are: – Use case diagram,

What is a Boundary?

• A boundary is the dividing line between the system and its environment.

• Use cases are within the boundary.

• Actors are outside of the boundary.

Page 12: Use Case Modeling. Kendall & Kendall© 2005 Pearson Prentice Hall18-2 Commonly Used UML Diagrams The most commonly used UML diagrams are: – Use case diagram,

Kendall & Kendall © 2005 Pearson Prentice Hall 18-12

Use Case

• Consists of three things:– An actor (user) that initiates an event.– An event that triggers a use case.– The use case that performs the actions triggered

by the event.

Page 13: Use Case Modeling. Kendall & Kendall© 2005 Pearson Prentice Hall18-2 Commonly Used UML Diagrams The most commonly used UML diagrams are: – Use case diagram,

Kendall & Kendall © 2005 Pearson Prentice Hall 18-13

Use Case (Continued)

• Better to create fewer use cases• 20 use cases for a large system• 50 use cases would be the maximum for a

large system• Can nest use cases, if needed

Page 14: Use Case Modeling. Kendall & Kendall© 2005 Pearson Prentice Hall18-2 Commonly Used UML Diagrams The most commonly used UML diagrams are: – Use case diagram,

What is a Connection?

• A connection is an association between an actor and a use case.

• Depicts a usage relationship

• Connection does not indicate data flow

Page 15: Use Case Modeling. Kendall & Kendall© 2005 Pearson Prentice Hall18-2 Commonly Used UML Diagrams The most commonly used UML diagrams are: – Use case diagram,

Kendall & Kendall © 2005 Pearson Prentice Hall 18-15

Use Case Relationships

• Communicates– Connect an actor to a use case

• Includes– Use case contains a behavior that is common to

more than one use case.– The common use case is included in other use

cases.– Dotted arrow points toward common use case.

Page 16: Use Case Modeling. Kendall & Kendall© 2005 Pearson Prentice Hall18-2 Commonly Used UML Diagrams The most commonly used UML diagrams are: – Use case diagram,

What is an <<include>> Relationship?

• A connection between two use cases

• Indicates a use case that is used (invoked) by another use case

• Links to general purpose functions, used by many other use cases

Page 17: Use Case Modeling. Kendall & Kendall© 2005 Pearson Prentice Hall18-2 Commonly Used UML Diagrams The most commonly used UML diagrams are: – Use case diagram,

Kendall & Kendall © 2005 Pearson Prentice Hall 18-17

Use Case Relationships (Continued)

• Extends– A different use case handles variations or

exceptions from the basic use case.– Arrow goes from extended to basic use case.

• Generalizes– One thing is more general than another thing.– Arrow points to the general thing.

Page 18: Use Case Modeling. Kendall & Kendall© 2005 Pearson Prentice Hall18-2 Commonly Used UML Diagrams The most commonly used UML diagrams are: – Use case diagram,

What is an <<extend>> Relationship?

• A connection between two use cases

• Extends a use case by adding new behavior or actions

• Specialized use case extends the general use case

Page 19: Use Case Modeling. Kendall & Kendall© 2005 Pearson Prentice Hall18-2 Commonly Used UML Diagrams The most commonly used UML diagrams are: – Use case diagram,

Kendall & Kendall © 2005 Pearson Prentice Hall 18-19

Use Case Relationships

Page 20: Use Case Modeling. Kendall & Kendall© 2005 Pearson Prentice Hall18-2 Commonly Used UML Diagrams The most commonly used UML diagrams are: – Use case diagram,
Page 21: Use Case Modeling. Kendall & Kendall© 2005 Pearson Prentice Hall18-2 Commonly Used UML Diagrams The most commonly used UML diagrams are: – Use case diagram,
Page 22: Use Case Modeling. Kendall & Kendall© 2005 Pearson Prentice Hall18-2 Commonly Used UML Diagrams The most commonly used UML diagrams are: – Use case diagram,

Kendall & Kendall © 2005 Pearson Prentice Hall 18-22

Steps for Creating a Use Case Model

The steps required to create a use case model are:– Review the business specifications and identify

the actors within the problem domain.– Identify the high-level events and develop the

primary use cases that describe the events and how actors initiate them.

Page 23: Use Case Modeling. Kendall & Kendall© 2005 Pearson Prentice Hall18-2 Commonly Used UML Diagrams The most commonly used UML diagrams are: – Use case diagram,

Kendall & Kendall © 2005 Pearson Prentice Hall 18-23

Steps for Creating a Use Case Model

• The steps required to create a use case model are (continued): – Review each primary use case to determine

possible variations of flow through the use case.– Develop the use case documents for all primary

use cases and all important use case scenarios.