1 / 17

Requirements Change!

Requirements Change!. Chapter 3 Object-Oriented Analysis and Design Tom Perkins. Welcome!. 10 (+) week book study Tom Perkins tomperki@gmail.com Books available at Nerdbooks.com http://69.41.237.216/STUDYGROUPSIG/OOAD. Chapter 3 Topics. Review Good software Use Cases

olin
Download Presentation

Requirements Change!

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. Requirements Change! Chapter 3 Object-Oriented Analysis and Design Tom Perkins

  2. Welcome! • 10 (+) week book study • Tom Perkins • tomperki@gmail.com • Books available at Nerdbooks.com • http://69.41.237.216/STUDYGROUPSIG/OOAD

  3. Chapter 3 Topics • Review • Good software • Use Cases • The One Constant in Software Design • Todd and Gina’s Idea • The Bark Recognizer Scenario • A Revised Use Case • Introducing the Bark Recognizer Object • Updating the Dog Door Simulator • Doug’s Idea • Duplicate Code for the Timer? • Class and Code Walkthrus

  4. Review (Chapter 1)3 Steps to Good Software • Make sure the software does what the customer wants it to do • Apply basic OO principles to add flexibility • Strive for a maintainable, reusable design

  5. Review – Chapter 2 What is a Use Case? A Use Case describes what your system does to accomplish a singular goal. Focuses on “what”, not “how” Single goal: different goal, different use case Main path; alternative paths (can occur only some of the time) Users outside the system: Gina, Todd, Fido Dog door and remote inside the system Formal Use Case: A technique for capturing the potential requirements of a new system or a software change. It provides one or more scenarios that convey how the system should interact with the end user or another system to achieve a specific goal. Scenario: a path through the use case that will result in the goal.

  6. Todd Gina Fido Your new programming job: Doug’s Dog Doors (High tech, automated dog doors) Your first Customers What they want: An automated, remote-controlled Dog Door barks !!! want to push button to open door No Problem !!!

  7. Todd and Gina’s Dog Door, Version 2.0 (Review) Dog Door Use Case 1. Fido barks to be let out. 2. Todd or Gina hears Fido barking. 3. Todd or Gina presses the button on the remote control. 4. The dog door opens. 5. Fido goes outside. 6. Fido does his business.. 6.1 The door shuts automatically. 6.2 Fido barks to be let in. 6.3 Todd or Gina hears Fido barking (again). 6.4 Todd or Gina presses button on remote control. 6.5 The dog door opens (again). 7. Fido goes back inside. 8. The door shuts automatically.

  8. The One Constant in Software Design Change

  9. Doug and Gina’s Idea Bark Recognizer Attachment Fido It (the dog door) is working great, but what if … Dog Door Opens! barks (Woof-Woof )!!!

  10. Fido barks Fido barks Recognizer hears Door shuts Recognizer Opens door Recognizer hears Fido out, does business Main path Alternate path Recognizer opens door Fido back in Door closes Note: Todd and Gina are not in this picture All is well

  11. A Revised Use Case Alternate paths: 2.1 Todd or Gina hears Fido 3.1 Todd or Gina presses remote control 6.1 Dog door shuts automatically 6.2 Fido barks 6.3 Bark recognizer hears bark 6.3.1 Todd or Gina hears 6.4. Bark recognizer requests 6.4.1 Todd or Gina presses remote 6.5 Dog door opens Main Path 1. Fido barks to be let out 2. Bark Recognizer hears 3. Bark Recognizer send open request 4. Dog door opens 5. Fido goes outside 6. Fido does his business. 7. Fido goes back inside. 8. Dog door shuts automatically

  12. Old Dog Door Object Walkthrus • DogDoor • Remote • Simulator object • Walkthru

  13. Dog Door with Bark RecognizerObject Walkthrus • Recognizer object • Code Walkthru • But the door stays open!!!

  14. Doug’s Idea! Put a timer on it! Just copy the one in the remote! Question: Duplicate the timer code in the Remote? Better solution: Put a single timer in the DogDoor class; remove the remote timer. DRY Principle (Don’t Repeat Yourself)

  15. The Modified DogDoor Class • Modify code • Run Simulator

  16. In-class exercise • Suppose it’s January in North Texas, and your car is parked overnight in your garage. • Write a use case that would describe the process you go through in starting your car and backing it onto the street. • Did you include any alternate paths? Does your car-starting experience always follow the “Happy Path”?

More Related