DOC PREVIEW
CU-Boulder CSCI 5448 - Ready for the Real World

This preview shows page 1-2-15-16-17-32-33 out of 33 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 33 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 33 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 33 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 33 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 33 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 33 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 33 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 33 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Ready for the Real WorldKenneth M. AndersonUniversity of Colorado, BoulderCSCI 4448/5448 — Lecture 8 — 09/17/20091Lecture Goals• Review material from Chapter 4 of the OO A&D textbook• Taking Your Software into the Real World• Alternative Designs / Design Trade-Offs• Use Case Analysis / More about Class Diagrams• Discuss the Chapter 4 Example: Todd & Gina’s Dog Door, Take 3• Emphasize the OO concepts and techniques encountered in Chapter 42Quiz (from last time)• Draw a UML class diagram that captures the following relationships• The world is a matrix of locations. Each location is a particular type of terrain (water, grass, forest, mountain) and may have the player on it or one or more creatures. A player can either be a warrior or a wizard. A warrior has access to one or more weapons, each that deal different amounts of damage and that have different ranges (e.g., a bow can attack a creature that is five squares or closer). A wizard has access to one or more spells, each that deal different amounts of damage, have different ranges, and that might linger for one or more turns. A creature has a description and two attacks, one melee and one ranged, that deal different amounts of damage. Both creatures and players have a certain number of hit points and know their current location in the world.3One Student Submission!4ΕΖΤΔΣΚΡΥΚΠΟΩΪΕΒΞΒΘΖΣΒΟΘΖΕΒΞΒΘΖΣΒΟΘΖΝΚΟΘΖΣΙΚΥΡΠΚΟΥMy attempt5x: Integery: IntegerLocationMountainWaterGrassForestWorldx, yx: Integery: IntegerhitPoints: IntegerEntityrange: Integerduration: IntegerAttackmin: Integermax: IntegerDamagePlayerdescription: StringCreatureWarrior Wizardrangedmelee* *A location can be empty, contain a single player or one or more creaturesspellsweaponsAn alternative…6x: Integery: IntegerLocationMountainWaterGrassForestWorldx, yhitPoints: IntegerEntityrange: Integerduration: IntegerAttackmin: Integermax: IntegerDamagePlayerdescription: StringCreatureWarrior Wizardrangedmelee* *A location can be empty, contain a single player or one or more creaturesspellsweapons*0..1Quiz7• What are the steps of a use case called?• What guideline (or guidelines) does this action step violate• “The systems gets the data and checks to see if its valid”• What are the semantics of an unadorned association between two classes?• Why does the addition of directionality and/or multiplicity make it harder to implement an association?Quiz8• What are the steps of a use case called?• action steps• What guideline (or guidelines) does this action step violate• “The systems gets the data and checks to see if its valid”•Write from a Bird’s Eye View and Do not use “checks whether”• What are the semantics of an unadorned association between two classes?• Multiplicity of 1 on each end; directionality in both directions• Why does the addition of multiplicity constraints make it more difficult to implement an association?• Multiplicity constraints must be maintained at run-timeReal World Context• A key problem in software development is gaining an understanding of the context in which your software must operate• Chapter 4 starts out by identifying a problem with our bark recognizer software from the end of Chapter 3: It opens for ANY bark… even if the bark belongs to some other dog!• In the perfect world, everyone uses your system just like you expect• As the book says “Everyone is relaxed and there are no multi-dog neighborhoods here!”• In the real world, (unexpected) stuff happens and things go wrong• Analysis is the tool that can help you understand your software’s real-world context, identify potential problems, and help you avoid them9The Role of Use Cases• A well written use case can aid us in our goal of identifying real-world problems during the analysis phase• They are your means of communicating with your customers, your managers, and other developers about how your system will work in the real world• A customer may look at your scenarios and say “these are not very realistic”• Be open to comments like this, because you can then learn how to change your use cases to take into account the problems that will be encountered in the real world• Once your use cases are updated, you can use them to glean the new requirements your system has to meet10Initial Changes• Make use case more generic• We’ve been a bit “folksy” up to now, referring to “Todd and Gina” and “Fido” in our use case• We’ll switch to using phrases like “owner” and “dog”•Except that in Boulder, we have to say “guardian” not “owner” ☺• We’ll update the use case to make sure that we specify that the bark recognizer opens the door ONLY for the “owner’s dog”• We were playing fast and loose with requirements last time• looking at what we needed to do to introduce BarkRecognizer to our design, without thinking long and hard about what it really needed to do11New Use Case12What the Door DoesMain Path1. The owner’s dog barks to be let out.2. The bark recognizer “hears” a bark.3. The bark recognizer detects the owner’s dog and opens the door.4. The dog door opens.5. The owner’s dog goes outside.6. The owner’s dog does his business.6.1 The door shuts automatically6.2 Fido barks to be let back inside.6.3 The bark recognizer “hears” a bark (again).6.4 The bark recognizer detects the owner’s dog and opens the door6.5 The dog door opens (again).7. Fido goes back inside.Alternate Paths2 The owner hears her dog barking.3 The owner presses the button on the remote control.6.3 The owner hears her dog barking (again).6.4 The owner presses the button on the remote control.Discussion• Note: I did things slightly differently from the book• I changed step 3 to say “The bark recognizer detects the owner’s dog and opens the door”• The book said “If it’s the owner’s dog barking, the bark recognizer sends a request to the door to open”• I didn’t like the use of “if” in this action step, instead I just decided that the bark we hear is always the owner’s dog.• I can add an additional path to this use case in which I can say something like: “The bark recognizer detects an unknown dog. Use case terminates.” Or I can create a separate use case that documents this behavior• Note: my version of step 3 can be


View Full Document

CU-Boulder CSCI 5448 - Ready for the Real World

Documents in this Course
Django

Django

42 pages

ENRS

ENRS

30 pages

PhoneGap

PhoneGap

22 pages

Load more
Download Ready for the Real World
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Ready for the Real World and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Ready for the Real World 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?