160 likes | 337 Views
Use Case Diagrams. Lecture Objectives. Explain use cases and use case modelling, including function decomposition Explain use scripts. Use Case Diagrams What are they?. One of the five diagramming techniques used in the UML to describe the dynamic properties of an IS.
E N D
Lecture Objectives • Explain use cases and use case modelling, including function decomposition • Explain use scripts
Use Case DiagramsWhat are they? • One of the five diagramming techniques used in the UML to describe the dynamic properties of an IS. • “Use cases are used to describe the outwardly visible requirements of a system”. Schneider & Winters (2001, p. 1) • “A use case achieves a discrete goal for the user”. Fowler with Scott (1997, p. 43) • Always involves a process so must description must contain a verb.
PSP Stock Controller DIQ Use Case DiagramsOverview Tuneswarehouse Title Sales Order Processing Outbound logistics Customer Actor Boundary Stock Control Inbound logistics Use Case Relationship
PSP Stock Controller DIQ Use Case DiagramsOverview Tuneswarehouse Title Sales Order Processing Outbound logistics Customer Actor Boundary Stock Control Inbound logistics Use Case Relationship
Customer Customer Stock Controller Use Case DiagramsUses Sales Order Processing Create Order Delete Order Uses Update Order Find Order Uses
Sales Assistant Use Case DiagramsExtends Hi-Fi Sales Sell Hi-Fi Extends Sell Warranty
Use Case DiagramsApproaches to Finding Use Cases • Actor-based approach: Use cases serve the actors. • First identify the system’s actors e.g., “Customer”, “Member”, “Finance Manager” • then define the processes that are required to meet their needs e.g., ‘Customer orders tracks’ and ‘Finance Manager pays royalties’. • In the case of human actors, the processes required are usually identified using techniques such as interviewing, questionnaires, user profiling, task observation and document inspection. • Likewise, producing and testing screen mock-ups and prototypes of the system can also be very useful here. • Essentially an outside-in approach.
Use Case DiagramsApproaches to Finding Use Cases • Event-driven approach: Identify what events the system must generate e.g., ‘download track’ or ‘create member’ • then work out which actors are able to initiate these events. • Essentially an inside-out approach. • Use case patterns: Standard use case patterns that tend to occur frequently in systems design. • Available in text books and on the web. • Can save us a great deal of time when modelling a system. • However, the correct application of comes with experience and those new to modelling should be careful when using this approach. • Also, because these patterns are standard, they cannot be used in isolation since all systems are unique.
Use Case ScriptsExample Title: Search for Hi-Fi by price Actors: Customer Use case does: Allows the use to select a H-Fi up to a maximum price. Use case begins: When the customer clicks the search by price button on the main search page. Use case ends: When the system displays the Hi-Fi up to the select price. Actors System 1. Selects the maximum price for Hi-Fi. 2. Clicks the search button. 3. Displays the available Hi-Fis in price range. Alternative Actions 2. Customer may select a brand. 2. Customer may go back to main search Page.
Use Case Scripts? • Textual description of a use case • More detailed and structured than a use case (on a diagram) • Allows modelling of alternate actions. • Conversational style between actor(s) and system • Often used to help define/find classes (see later) • Describe only common behaviours e.g., do not go into rare events such as system crashes - Use Case Scripts should make sense to users. • Script only the lowest level (atomic) uses case.
Lecture Objectives • Explain use cases and use case modelling, including function decomposition • Explain use scripts
Lecture Objectives • Explain use cases and use case modelling, including function decomposition • Explain use scripts
Lecture Exercises • Produce a set of use cases for a drinks vending machine. • Produce a use case script for one of the uses cases you produced above.