1 / 68

Software Development 2011-2014 Theory Slideshows

Use Cases UML. Software Development 2011-2014 Theory Slideshows. By Mark Kelly Edited and Modified by Mr Hem. Use-case actors relaxing. UML. Unified Modelling Language A standard graphical language to model computer applications.

Download Presentation

Software Development 2011-2014 Theory Slideshows

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Use Cases UML Software Development 2011-2014Theory Slideshows By Mark Kelly Edited and Modified by Mr Hem Use-case actors relaxing

  2. UML • Unified Modelling Language • A standard graphical language to model computer applications. • Is programming-language independent, can be used with C++, Visual Basic, Java, Python: anything.

  3. UML UML provides several types of diagrams to represent applications under development. • class diagram • sequence diagram • statechart diagram • component diagram • deployment diagram. • activity diagram And...

  4. Use Case Diagram • UCD • The diagram we need to know for VCE SD. • Is a picture of functional requirements in an information system. • Lists the tasks that a system can do.

  5. Use Case Diagram: • Used during analysis phase of PSM • Maps out the functional requirements of a system • Describes what a system does from the standpoint of an external observer. • The emphasis is on what a system does rather than how. • (How is worked out during design phase of PSM)

  6. UCD • Serves to scope the system’s high-level functionality • Defines what functions will or will not be performed by the system • Shows developers if they have missed anything important. • help development teams visualise the functional requirements of a system • Used to highlight new requirements as the system is analysed and the design takes shape. • E.g. “if we now want the system to do X, we’ll also need it to do A, B and C.”

  7. UCD • Good tool for communicating with clients due to their simplicity. • Umm – simplicity of the UCD, not the client. • Well, usually.

  8. UCD COMPONENTS • Actors • Use Cases • Relationships (communications) • Includes, extends • System boundaries

  9. ACTORS • A person, organisation, or external system that plays a role in the system being developed. • May initiate or participate in processes. • Actors are drawn as stick figures. • Cos stick figures are cool. • Like ninjas, but without swords.

  10. ACTORS • Always drawn around the edges of the UCD • The same actor only appears once in a UCD • Must be connected to at least one process • ‘Process’ is called a Use Case.

  11. Use Case • Pronounced “yoose case”, not “yooze case” • Drawn as an oval • Name is put in or under the oval • Name must start with an active verb (“make”, “open” etc)

  12. Watch out! • In a use case’s name don't combine sentences with commas or 'and'. • This implies that interactions have been combined. • Same rule applies in DFDs

  13. Association • Sometimes called “communication” • Shown as a line. • Sometimes shown as arrow (more details later) • Connects an actor to a use case. • Each actor may be associated with several use cases. • Each use case may be associated with several actors.

  14. Arrowed associations Important thing to make clear now • Arrows do not indicate data flow! • They are not Data Flow Diagrams (DFD) • Communication is always two way between actor and use case.

  15. Arrows in UCD • An arrow just indicates which actor initiated the use case (the primary actor) and which actor was affected by it starting (the passive actor) • With no arrow, it’s unclear which actor started a use case...

  16. Example Can a patient make an appointment, or can a scheduler? Or both? Can a scheduler cancel an appointment? Hard to say.

  17. Reading a UCD A patient calls the clinic to make an appointment.

  18. Reading a UCD • The “Make Appointment” use case contains the procedures involved in that activity • The use case will define the procedures for setting up the appointment.

  19. Reading a UCD • The patient may request medication. • The “Request medication” use case specifies how the system will handle that request for medication.

  20. Reading a UCD • The “Pay Bill” use case will describe procedures for bill payment

  21. Reading a UCD • Perhaps these procedures will be in the “Pay Bill” use case: • generate invoice • send invoice • cash the cheque • send a receipt

  22. Version 2 • Arrows make it clearer: • Only patients make and cancel appointments, not schedulers • Patients request medication, doctors respond • Clerks begin the bill payment use case. Patients respond.

  23. Quick Quiz • How many actors are in this UCD? • How many communications (associations)? • How many use cases? • Can a doctor request that a patient be given medication? • Think it out...

  24. Quick Quiz • How many actors are in this UCD? 4 • How many communications (associations)? 8 • How many use cases? 4 • Can a doctor request that a patient be given medication? Yes.

  25. Actors are roles, not individuals or job titles • Mr Southerby as CEO needs access to management information. • Fred Smith as Order Entry Clerk needs to enter orders.

  26. Actors are roles, not individuals or job titles • Sometimes Mr Southerby may need to enter an order when Fred isn't there... • But DON’T draw an arrow between Mr Southerby and the Enter Order use case!

  27. Actors are roles, not individuals or job titles • Entering orders is not the role of the CEO. • It’s the role of the clerk. • So when Mr Southerby enters orders, he’s taking on the role of Order Entry Clerk.

  28. Actors are roles, not individuals or job titles • The system does not know or care which individual is entering orders. • The system cares which agent is doing it. • And when Mr S enters an order, he is at that moment the agent called the ‘order entry clerk’.

  29. Actors are roles, not individuals or job titles • When naming actors, think of the role that a person takes on rather than their name or job title. • Most job titles involve the putting on of a number of different hats in different situations. • Name the actor with the role, not ajob title. Think hats! The final UCD

  30. More practice • Which actor initiates the entering of an order? • Which actor responds to an order being entered? • Is the Accounts System actor a human? • Who starts off the getting of an address? • Can the Accounts System cancel an order? • During order entry, does the accounts system send information to the order entry clerk? • Who is the passive actor during order entry? • Who is the primary actor during order entry?

  31. More practice • Which actor initiates the entering of an order? • The clerk.

  32. More practice • Which actor responds to an order being entered? • The accounts system.

  33. More practice • Is the Accounts System actor a human? • No, it’s an information system.

  34. More practice • Who starts off the getting of an address? • The accounts system.

  35. More practice • Can the Accounts System cancel an order? • No.

  36. More practice During order entry, does the accounts system send information to the order entry clerk? Yes. The arrow does not indicate the direction of data flow. Data flow is always 2-way (unlike a DFD)

  37. More practice Who is the passive actor during order entry? The accounts system.

  38. More practice • Who is the primary actor during order entry? • The clerk.

  39. Another example • Use-case diagrams generally show groups of use cases. • What can you deduce from this UCD?

  40. Another example • This system lets the band manager view a sales statistics report and the Billboard report for the band's CDs.

  41. Another example • It also lets the record manager view a sales statistics report and the Billboard report for a particular CD.

  42. Another example • Our system fetches Billboard reports from an external system called Billboard Reporting Service.

  43. Another example • In addition, the absence of use cases in this diagram shows what the system doesn't do. • There is no way for a band manager to listen to songs from the different albums on the Billboard because we see no reference to a use case called Listen to Songs from Billboard 200. • This absence is not a trivial matter. • It might show developers that extra functionality is required of the system.

  44. <<INCLUDE>> • <<include>> • like a subprogram • denotes the inclusion of behaviour described by another use case.  • saves repetition and wasted space. • Shown as a dotted line with “<<include>>” label

  45. <<INCLUDE>> • Both the Manage Customer Details and Enter Order use cases include the Find Customer Record use case. • They both have the procedures from Find Customer Record in common.

  46. Like a conditional <<include>>. • Only takes place under certain conditions. • An <<extend>> is a use case that extends another use case (the ‘base’ use case) when circumstances require it. • When the extending use case’s activities are finished, the base use case’s activities resume from the point they branched off into the <<extend>> use case. <<extend>>

  47. Like a conditional <<include>>. • Only takes place under certain conditions. • An <<extend>> is a use case that extends another use case (the ‘base’ use case) when circumstances require it. • When the extending use case’s activities are finished, the base use case’s activities resume from the point they branched off into the <<extend>> use case. <<extend>>

  48. The extending use case is really an alternate course of the base use case • It can be used to describe different actions to be taken dependent on current condition.  • In other words, it can indicate conditional branches in activities. • Shown as a dotted line with “<<extend>>” label <<extend>>

  49. <<extend>> Note how some activities only take place if wine has been ordered. Note: Solid lines or arrows between use cases are not allowed. The only way to link use cases is with includes or extends.

  50. Creating a UCD Then convert the text to a UCD: • Clerk enters customer ID into system. • If ID exists, account management module is triggered. • Otherwise, New Account module is triggered. • Then, clerk enters a product IDs of customer's purchase. • If an item is not in stock, customer is advised of delay in delivery and the back-order process is triggered. • 4 to 5 may be repeated • Clerk then.... (etc)

More Related