Download presentation
Presentation is loading. Please wait.
Published byChristian Simmons Modified over 9 years ago
1
Use Case Diagram in Detail CT1414 October 2011 By: Fatimah Alakeel
2
2 Using Use Case Diagrams Use case diagrams are used to visualize, specify, construct, and document the (intended) behavior of the system, during requirements capture and analysis. Provide a way for developers, domain experts and end-users to Communicate. Serve as basis for testing. Use case diagrams contain use cases, actors, and their relationships.
3
3 Use case Diagram in System Documentation Use Case helps to model system requirements Easy for users to understand
4
4 Use case concept Use case is a model of system functionality. Think of main functions a system performs for users – “cases” of using a system. Figure 6-3 Use Case Diagram of Order-Entry Subsystem for RMO Use case
5
5 Business Event concept Figure 5-2 Events affecting a Charge Account Processing System that determine what system has to do – functions, use cases A stimulus that requires a system’s response Delineated in time; stands on its own
6
6 Event types External Events – Caused by external agent (human, system) Temporal Events – Occur when system reaches a point in time; calendar time tracking in computer State Events – Asynchronous events responding to a system trigger (e.g., if QuantityOnHand=<ReorderAmount, create purchasing order)
7
7 Figure 5-10 InputOutput Events Table
8
Elements of Use Case Diagram: 1-Use Case2-Actor3-Relationships Between use cases GeneralizationIncludeExtendBetween Actors Between use cases and actors
9
1- USE CASE
10
10 Use Case Use cases specify desired behavior. A use case is a description of a set of sequences of actions, including variants, a system performs to yield an observable result of value to an actor. Each sequence represent an interaction of actors with the system. name
11
11 Specifying the Behavior of a Use Case Describing the flow of events within the use case. Can be done in natural language, formal language or pseudo-code. Includes: how and when the use case starts and ends; when the use case interacts with actors and what objects are exchanged; the basic flow and alternative flows of the behavior.
12
12 Use Case System function (process – automated or manual). Named by v erb. Do something Each Actor must be linked to a use case, while some use cases may not be linked to actors. = Use Case
13
2- ACTOR
14
14 Actor Actor is someone interacting with use case (system function). Named by noun. Similar to the concept of user, but a user can play different roles ; (example: a professor can be an instructor and a researcher – plays 2 roles with two systems). Actor triggers use case. Actor has responsibility toward the system (inputs), and Actor have expectations from the system (outputs). Name
15
15 Actors An actor represents a set of roles that users of use case play when interacting with these use cases. Actors can be human or automated systems. Actors are entities which require help from the system to perform their task or are needed to execute the system’s functions. Actors are not part of the system. name
16
16 Use Cases and Actors From the perspective of a given actor, a use case does something that is of value to the actor, such as calculate a result or change the state of an object. The Actors define the environments in which the system lives
17
3- RELATIONSHIPS
18
18 3.1 Relationships between Use Cases 1. Generalization - use cases that are specialized versions of other use cases. 2. Include - use cases that are included as parts of other use cases. Enable to factor common behavior. 3. Extend - use cases that extend the behavior of other core use cases. Enable to factor variants.
19
19 1. Generalization The child use case inherits the behavior and meaning of the parent use case. The child may add to or override the behavior of its parent. parent child
20
20 registration graduate registration non-graduate registration More about Generalization
21
Generalization Example The actor Order Registry Clerk can instantiate the general use case Place Order. Place Order can also be specialized by the use cases Phone Order or Internet Order.
22
Generalization Example
23
23 2. Include The base use case explicitly incorporates the behavior of another use case at a location specified in the base. The included use case never stands alone. It only occurs as a part of some larger base that includes it. baseincluded >
24
ניתוח מערכות מידע 24 More about Include Enables to avoid describing the same flow of events several times by putting the common behavior in a use case of its own. updating grades output generating verifying student id >
25
25 Include relationship Include relationship – a standard case linked to a mandatory use case. Standard use case can NOT execute without the include case tight coupling. Example: to Authorize Car Loan (standard use case), a clerk must run Check Client’s Credit History (include use case). The standard UC includes the mandatory UC (use the verb to figure direction arrow). Note: Visio calls this “uses” relationship.
26
26 Reading use case diagram with Include relationship
27
Include Example
28
28 3. Extend The base use case implicitly incorporates the behavior of another use case at certain points called extension points. The base use case may stand alone, but under certain conditions its behavior may be extended by the behavior of another use case. baseextending >
29
29 More about Extend Enables to model optional behavior or branching under conditions. Exam copy request Exam-grade appeal >
30
30 Extend relationship – linking an optional use case to a standard use case. Extend relationship Example: Register Course (standard use case) may have Register for Special Class (extend use case) – class for non-standard students, in unusual time, with special topics, requiring extra fees…). The optional UC extends the standard UC Standard use case can execute without the extend case loose coupling.
31
Extend Example
32
32 3.2 Relationships between Actors Generalization. student non-graduate student graduate student
33
33 3.3 Relationships between Use Cases and Actors Actors may be connected to use cases by associations, indicating that the actor and the use case communicate with one another using messages. updating grades faculty
34
34 Example place phone call cellular network user receive phone call place conference call receive additional call use scheduler > Cellular Telephone
35
35 A More Complicate Example
36
36 Each use case may include all or part of the following: Title or Reference Name- meaningful name of the UC Author/Date- the author and creation date Modification/Date- last modification and its date Purpose- specifies the goal to be achieved Overview- short description of the processes Cross References- requirements references Actors- agents participating Pre Conditions- must be true to allow execution Post Conditions- will be set when completes normally Normal flow of events- regular flow of activities Alternative flow of events - other flow of activities Exceptional flow of events - unusual situations Implementation issues- foreseen implementation problems Use Case Description Eac h use cas e ma y incl ud e all or par t of the foll owi ng: Titl e or Ref ere nce Na me - me ani ngf ul na me of the UC Aut hor /Da te - the aut hor of the UC an d its cre ati on dat e Mo difi cati on/ Dat e - last mo difi cati on to the UC an d its dat e Pur pos e - spe cifi es the goa l to be ach iev ed by the UC Ov erv iew - sho rt des crip tio n of the use cas es pro ces ses Cro ss Ref ere nce s - req uir em ent s ref ere nce s Act ors - age nts whi ch init iate or par tici pat e in the UC Pre Co ndi tio ns - mu st be tru e to allo w the exe cuti on of the UC Pos t Co ndi tio ns - will be set wh en the use use co mp let es its exe cuti on nor mal ly Nor mal flo w of eve nts - reg ula r flo w of acti viti es of the UC Alt ern ativ e flo w of eve nts - oth er flo w of acti viti es of the UC Exc ept ion al flo w of eve nts - un usu al situ ati ons Im ple me nta tio n iss ues - pos sibl e for ese en pro ble ms in the im ple me nta tio n of the UC
37
EXAMPLE
38
38 Example- Money Withdraw Use Case: Withdraw Money Author: ZB Date: 1-OCT-2004 Purpose: To withdraw some cash from user’s bank account Overview: The use case starts when the customer inserts his credit card into the system. The system requests the user PIN. The system validates the PIN. If the validation succeeded, the customer can choose the withdraw operation else alternative 1 – validation failure is executed. The customer enters the amount of cash to withdraw. The system checks the amount of cash in the user account, its credit limit. If the withdraw amount in the range between the current amount + credit limit the system dispense the cash and prints a withdraw receipt, else alternative 2 – amount exceeded is executed. Cross References: R1.1, R1.2, R7
39
39 Example- Money Withdraw (cont.) Actors: Customer Pre Condition: – The ATM must be in a state ready to accept transactions – The ATM must have at least some cash on hand that it can dispense – The ATM must have enough paper to print a receipt for at least one transaction Post Condition: – The current amount of cash in the user account is the amount before the withdraw minus the withdraw amount – A receipt was printed on the withdraw amount – The withdraw transaction was audit in the System log file
40
40 Example- Money Withdraw (cont.) Typical Course of events: Actor Actions System Actions 1. Begins when a Customer arrives at ATM 2. Customer inserts a Credit card into ATM 3. System verifies the customer ID and status 5. Customer chooses “Withdraw” operation 4. System asks for an operation type 7. Customer enters the cash amount 6. System asks for the withdraw amount 8. System checks if withdraw amount is legal 9. System dispenses the cash 10. System deduces the withdraw amount from account 11. System prints a receipt 13. Customer takes the cash and the receipt 12. System ejects the cash card
41
41 Example- Money Withdraw (cont.) Alternative flow of events: – Step 3: Customer authorization failed. Display an error message, cancel the transaction and eject the card. – Step 8: Customer has insufficient funds in its account. Display an error message, and go to step 6. – Step 8: Customer exceeds its legal amount. Display an error message, and go to step 6. Exceptional flow of events: – Power failure in the process of the transaction before step 9, cancel the transaction and eject the card
42
42 Example- Money Withdraw (cont.) One method to identify use cases is actor-based: - Identify the actors related to a system or organization. - For each actor, identify the processes they initiate or participate in. A second method to identify use cases is event-based: - Identify the external events that a system must respond to. - Relate the events to actors and use cases. The following questions may be used to help identify the use cases for a system: -What are tasks of each actor ? -Will any actor create, store, change, remove, or read information in the system ? -What use cases will create, store, change, remove, or read this information ? -Will any actor need to inform the system about sudden, external changes ? -Does any actor need to be informed about certain occurrences in the system ? -Can all functional requirements be performed by the use cases ?
43
43 Moving on The “things” that “live” inside the system are responsible for carrying out the behavior the actors on the outside expect the system to provide. To implement a use case, we create a society of classes that work together to carry out the behavior of the use case.
44
44 How to create use case diagram 1. List main system functions (use cases) in a column: – think of business events demanding system’s response – users’ goals/needs to be accomplished via the system – Create, Read, Update, Delete (CRUD) data tasks 2. Draw ovals around the function labels 3. Draw system boundary 4. Draw actors and connect them with use cases (if more intuitive, this can be done as step 2) 5. Specify include and extend relationships between use cases
45
45 Elements of use case diagram Summary Boundary of system > Include relationship between Use Cases (one UC must call another; e.g., Login UC includes User Authentication UC) > Extend relationship between Use Cases (one UC calls Another under certain condition; think of if-then decision points) Connection between Actor and Use Case
46
Elements of use case diagram Summary name Use case, starts with a verb Actor can be human or other system
47
Extra reading http://www.andrew.cmu.edu/course/90- 754/umlucdfaq.html http://www.andrew.cmu.edu/course/90- 754/umlucdfaq.html
48
References http://www.umanitoba.ca/faculties/managem ent/faculty/btravica/9351/class8.ppt http://www.umanitoba.ca/faculties/managem ent/faculty/btravica/9351/class8.ppt http://brd4.braude.ac.il/~zbarzilay/L04_UML1 _UseCase[2].ppt http://brd4.braude.ac.il/~zbarzilay/L04_UML1 _UseCase[2].ppt http://www.ts.mah.se/RUP/RationalUnifiedPr ocess/process/modguide/md_ucgen.htm http://www.ts.mah.se/RUP/RationalUnifiedPr ocess/process/modguide/md_ucgen.htm
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.