University of Toronto Department of Computer Science Lecture 15 Modelling System Interactions Interactions with the new system How will people interact with the system When Why will they interact with the system Use Cases introduction to use cases identifying actors identifying cases Advanced features Sequence Diagrams Temporal ordering of events involved in a use case 2004 5 Steve Easterbrook This presentation is available free for non commercial use with attribution under a creative commons license 1 University of Toronto Department of Computer Science Moving towards specification What functions will the new system provide How will people interact with it Describe functions from a user s perspective UML Use Cases Used to show the functions to be provided by the system which actors will use which functions Each Use Case is a pattern of behavior that the new system is required to exhibit a sequence of related actions performed by an actor and the system via a dialogue An actor is anything that needs to interact with the system a person a role that different people may play another external system 2004 5 Steve Easterbrook This presentation is available free for non commercial use with attribution under a creative commons license 2 Department of Computer Science University of Toronto Use Case Diagrams Capture the relationships between actors and Use Cases Change a client contact Campaign Manager Staff contact Add a new client Record client payment Accountant 2004 5 Steve Easterbrook This presentation is available free for non commercial use with attribution under a creative commons license 3 Department of Computer Science University of Toronto Notation for Use Case Diagrams Use case Change client contact Staff contact Actor Communication association System boundary 2004 5 Steve Easterbrook This presentation is available free for non commercial use with attribution under a creative commons license 4 Department of Computer Science University of Toronto Example Add new staff member Add new staff grade Change rate for staff grade Accountant Change grade for staff member Calculate staff bonuses 2004 5 Steve Easterbrook This presentation is available free for non commercial use with attribution under a creative commons license 5 Department of Computer Science University of Toronto extends and uses extends when one use case adds behaviour to a base case used to model a part of a use case that the user may see as optional system behavior also models a separate sub case which is executed conditionally uses one use case invokes another like a procedure call used to avoid describing the same flow of events several times puts the common behavior in a use case of its own extends Check Campaign Budget Print Campaign Summary uses Find Campaign 2004 5 Steve Easterbrook This presentation is available free for non commercial use with attribution under a creative commons license 6 Department of Computer Science University of Toronto Sample use cases for a car Driver Mechanic GasAttendant Fill Up uses Drive Check Oil uses Fix Car extends uses uses Turn On Engine Fix car on the road 2004 5 Steve Easterbrook This presentation is available free for non commercial use with attribution under a creative commons license 7 Department of Computer Science University of Toronto Meeting Scheduler Example Initiator Participant Generate Schedule us es es us es Schedule meeing Withdraw us uses Provide Edit Constraints extends constraints Validate User s e s u 2004 5 Steve Easterbrook This presentation is available free for non commercial use with attribution under a creative commons license 8 Department of Computer Science University of Toronto Generalizations Actor classes It s sometimes useful to identify classes of actor E g where several actors belong to a single class Some use cases are needed by all members in the class Other use cases are only needed by some members of the class Actors inherit use cases from the class Generalisation relations Read as is a member of or just is a Use Case classes Sometimes useful to identify a generalization of several use cases 2004 5 Steve Easterbrook This presentation is available free for non commercial use with attribution under a creative commons license 9 Department of Computer Science University of Toronto Identifying Actors Ask the following questions Who will be a primary user of the system primary actor Who will need support from the system to do her daily tasks Who or what has an interest in the results that the system produces Who will maintain administrate keep the system working secondary actor Which hardware devices does the system need With which other systems does the system need to interact with Look for the users who directly use the system also others who need services from the system 2004 5 Steve Easterbrook This presentation is available free for non commercial use with attribution under a creative commons license 10 University of Toronto Department of Computer Science Finding Use Cases For each actor ask the following questions Which functions does the actor require from the system What does the actor need to do Does the actor need to read create destroy modify or store some kinds of information in the system Does the actor have to be notified about events in the system Does the actor need to notify the system about something What do those events require in terms of system functionality Could the actor s daily work be simplified or made more efficient through new functions provided by the system 2004 5 Steve Easterbrook This presentation is available free for non commercial use with attribution under a creative commons license 11 University of Toronto Department of Computer Science Documenting Use Cases For each use case prepare a flow of events document written from an actor s point of view describe what the system must provide to the actor when the use case is executed Typical contents How the use case starts and ends Normal flow of events Alternate flow of events Exceptional flow of events Documentation style Choice of how to represent the use case English language description Activity Diagrams good for business process Collaboration Diagrams good for high level design Sequence Diagrams good for detailed design 2004 5 Steve Easterbrook This presentation is available free for non commercial use with attribution under a creative commons license 12 University of Toronto Department of Computer Science Modelling Sequences of Events Objects own
View Full Document
Unlocking...