CHAPTER 5.pdf
Document Details
Uploaded by DivineSonnet
Tags
Full Transcript
CHAPTER 5 What is a Use Case? A use case is like a storybook that narrates how a user (Main Character) interacts with a system (Sub Character) to achieve a specific goal. Key Components of a Use Case 1. Use Case Name Definition: This is the title of t...
CHAPTER 5 What is a Use Case? A use case is like a storybook that narrates how a user (Main Character) interacts with a system (Sub Character) to achieve a specific goal. Key Components of a Use Case 1. Use Case Name Definition: This is the title of the use case. It should be a short and descriptive name that clearly identifies the purpose of the use case. Example: "Login to System" or "Place Order." What It Does: This is the name that identifies what the use case is all about—like the title of a book! 2. Scenario Definition: Tells the story between the user and system. Example: "Customer logs in via social media" vs. "Customer logs in with email." What It Does: This describes different ways the use case can play out, depending on the situation—like alternate endings in a story! 3. Triggering Event Definition: The specific event or action that initiates the use case. This is what causes the use case to start. Example: "User clicks the 'Login' button." What It Does: This is the action that starts the use case, like ordering off Shien 4. Brief Description Definition: A short summary of what the use case does, describing the main goal or objective that the use case aims to achieve. Example: "This use case allows a registered user to log in." What It Does: It provides a short overview of what the use case accomplishes—like the back cover of a book! 5. Actors Definition: The entities (usually users or other systems) that interact with the system in this use case. The primary actor is the one that initiates the use case. Example: "Customer," "Admin," "Payment Gateway." What It Does: These are the characters involved in the use case, representing users or systems that interact with the main system. 6. Related Use Cases Definition: Use cases that are related to the current one through inclusion () or extension () relationships. These relationships define how different use cases work together. Example: "Login" might include "Forgot Password." What It Does: This shows how different use cases are connected, like characters who appear in multiple stories. 7. Stakeholders Definition: The individuals or groups who have an interest in the outcome of the use case. These might include the users, developers, customers, or other business units. Example: "System administrators," "Customers." What It Does: These are the people who have an interest in the outcome of the use case, like fans of a movie! 8. Preconditions Definition: The conditions or state that must be true before the use case can start. These ensure that the system is ready to execute the use case. Example: "User must be registered." What It Does: These are the rules that must be true before the use case can start—like needing a ticket to enter a concert! 9. Postconditions Definition: The conditions that will be true after the use case has been completed successfully. These describe the state of the system after the use case execution. Example: "User is logged in." What It Does: This describes what happens after the use case is completed successfully—like the resolution of a plot! 10. Flow of Activities Definition: A step-by-step sequence of actions that are performed during the execution of the use case. This is the main path or scenario of the use case. Example: User enters username → System validates → User gains access. What It Does: This outlines the sequence of actions taken during the use case, like the chapters in a book. 11. Exception Conditions Definition: These describe what happens when something goes wrong during the execution of the use case. It covers alternative paths that might be taken due to errors or exceptions. Example: "If the user enters wrong credentials, show an error." What It Does: These describe what happens when things go wrong, providing alternative paths—like unexpected surprises in a story! Why Use Cases Matter! Clarify Requirements: They help everyone understand what the system should do from the user's perspective. Guide Design and Development: They provide a roadmap for developers on how the system should behave. Facilitate Testing: They offer scenarios for testing the system's functionality. Improve Communication: They ensure all stakeholders are on the same page about the system's capabilities. Why Use Case Diagrams? Use case diagrams visually represent the interactions between users (actors) and the system, making it easier to understand the relationships and flow of activities. Here’s why they’re important: Visual Clarity: Diagrams provide a clear visual representation of the use case, making it easier to understand complex interactions at a glance. Symbols for a UML Activity Diagram Use Case! 1. Oval (Activity/Action) Function: Each activity or action represents a specific step or task in the workflow. Example: "Lookup Sale with SaleItems" or "Display Sale & SaleItems + Customer info." What It Does: Think of ovals as the action-packed scenes in our story where something exciting happens! 2. Diamond (Decision Node) Function: Used to depict a decision point where the flow can branch into multiple paths based on a condition. Example: "Available?" is a decision node where the flow can split into "Yes" (available) and "No" (not available). What It Does: Diamonds are like plot twists in a story, where the hero must decide which path to take based on conditions! 3. Fork/Join Bar (Parallel Flow) Function: Represents the point where the flow splits into parallel activities (fork) or where parallel activities join back together (join). Example: A horizontal bar labeled "For each SaleItem" indicates that for each item, the process checks availability. What It Does: Forks and joins are like scenes in a movie where multiple storylines happen at once before coming back together! 4. Arrow (Flow/Transition) Function: Indicates the flow of control from one activity to the next. Example: The arrow from "Lookup Sale with SaleItems" to "Display Sale & SaleItems + Customer info." What It Does: Arrows guide us through the story, showing the sequence of actions like a path through a maze! 5. Swimlanes Function: Separate activities performed by different actors or components within the system. Example: A swimlane for "Shipping Clerk" and another for "System." What It Does: Swimlanes are like different tracks in a relay race, showing which actor is responsible for which actions! 6. End Node (Filled Circle) Function: Represents the final state or end of the process. Example: The filled black circle at the end of the process indicates completion. What It Does: The end node is the grand finale of our story, where everything wraps up nicely! 7. Start Node (Empty Circle) Function: Indicates where the process begins. Example: An empty circle at the beginning of the diagram. What It Does: The start node is like the opening scene of a movie, setting the stage for the adventure to come! Exercise: Use Case and UML Activity Diagram Scenario: Online Bookstore System Background: You are designing a use case for an online bookstore system. The main goal is to allow users to search for books and place orders. 1.Create a Use Case Description ( Draw a table like the one in your slides) 2.Create a UML Activity Diagram Draw an Activity Diagram: