Chapter 17 – Object-Oriented DesignChapter GoalsSoftware Life CycleSlide 41. Analysis2. Design3. Implementation4. Testing5. DeploymentExamplePerfect WorldWaterfall ModelProblems with Waterfall ModelWhat’s the flaw?Spiral ModelSpiralSlide 17Extreme ProgrammingSlide 19Slide 20Surprising resultsDiscovering ClassesSlide 23Slide 24PowerPoint PresentationExample: InvoiceKey pointsKey PointsSlide 29BehaviorCRC CardSlide 32CRC DesignRelationships Between Classes3 relationshipsInheritanceSlide 37AggregationAggregation vs. InheritanceSlide 40Slide 41Slide 42DependencySlide 44Slide 45Class DiagramAttributes and Methods in UML DiagramsAggregation and AssociationChapter 17 – Chapter 17 – Object-Oriented Object-Oriented DesignDesignChapter GoalsChapter GoalsTo learn about the software life cycle To learn about the software life cycle To learn how to discover new classes and methods To learn how to discover new classes and methods To understand the use of CRC cards for class To understand the use of CRC cards for class discovery discovery To be able to identify inheritance, aggregation, and To be able to identify inheritance, aggregation, and dependency relationships between classes dependency relationships between classes To master the use of UML class diagrams to To master the use of UML class diagrams to describe class relationships describe class relationships To learn how to use object-oriented design to build To learn how to use object-oriented design to build complex programs complex programsSoftware Life CycleSoftware Life CycleSoftware Life Cycle: all activities from Software Life Cycle: all activities from initial analysis until obsolescence initial analysis until obsolescence Formal process for software developmentFormal process for software developmentDescribes phases of the development Describes phases of the development process process Gives guidelines for how to carry out the Gives guidelines for how to carry out the phases phasesSoftware Life CycleSoftware Life Cycle1.1.Analysis Analysis 2.2.Design Design 3.3.Implementation Implementation 4.4.Testing Testing 5.5.Deployment / OperationDeployment / Operation1. Analysis1. AnalysisDecide Decide whatwhat the project is suppose to do, the project is suppose to do, what the goal of the final product iswhat the goal of the final product isDo Do NOTNOT think about think about howhow the program will the program will accomplish tasks accomplish tasks Output of this phase - requirements Output of this phase - requirements document document Describes what program will do once completed Describes what program will do once completed Example – Example – User manual: tells how user will operate program User manual: tells how user will operate program Performance criteria (will complete X tasks in Y time)Performance criteria (will complete X tasks in Y time)2. Design2. DesignPlan for implementationPlan for implementationDecide what structures will best suit your taskDecide what structures will best suit your taskIn object-oriented programming, this is In object-oriented programming, this is choosing the classes and methods to use (and choosing the classes and methods to use (and create)create)Output: Classes and methods descriptionOutput: Classes and methods descriptionUsually diagramed using UML, can use CRC cardsUsually diagramed using UML, can use CRC cards3. Implementation3. ImplementationActual coding part of the processActual coding part of the processEdit Edit Compile Compile Run RunOutput: Completed programOutput: Completed program4. Testing4. TestingRun tests to verify the program works Run tests to verify the program works correctlycorrectlyRemember the two main types of Remember the two main types of testingtestingUnit TestingUnit TestingSystem TestingSystem Testing Output: a report of the tests and their Output: a report of the tests and their results results5. Deployment5. DeploymentAKA Operation, MaintenanceAKA Operation, MaintenanceUsers install program Users install program Users use program for its intended Users use program for its intended purpose purpose Bug fixesBug fixesNew featuresNew featuresExampleExampleAnalysis – the specs we provideAnalysis – the specs we provideDesign – We provided for first four Design – We provided for first four assignments, what you did for A5assignments, what you did for A5Implementation – the code you write to Implementation – the code you write to solve the specssolve the specsTesting – PathTester, Testing – PathTester, BankAccountTester, etc.BankAccountTester, etc.Deployment – TAs using your program Deployment – TAs using your program on sample runs. Our reaction is your on sample runs. Our reaction is your gradegradePerfect WorldPerfect WorldIn a perfect world, everything would In a perfect world, everything would flow perfectly in this processflow perfectly in this processOutput from one phase signifies it is Output from one phase signifies it is complete and can start the next phasecomplete and can start the next phaseDoesn’t really workDoesn’t really workYou’ve probably noticed thisYou’ve probably noticed thisWas anyone’s A5 perfect?Was anyone’s A5 perfect?Have your tests every worked Have your tests every worked completely?completely?Waterfall ModelWaterfall ModelProblems with Waterfall Problems with Waterfall ModelModelSpecs usually have flawsSpecs usually have flawsContradictionsContradictionsNon-thorough (what needs to happen on Non-thorough (what needs to happen on bad input?)bad input?)Design too complicated, Design too complicated, implementation flawedimplementation flawedTesting incompleteTesting incompleteWhat’s the flaw?What’s the flaw?Customer didn’t know what to expectCustomer didn’t know what to expectHow can you fully specify what the How can you fully specify what the program needs to do without seeing it?program needs to do without seeing it?Analogous to the edit-compile-run Analogous to the edit-compile-run cyclecycleNever get it right the first time, have to Never get it right the first time, have to iterate back to prior phasesiterate back to prior phasesSpiral ModelSpiral ModelBreaks development process down Breaks development process down into multiple phases into multiple phases Early phases focus on the Early phases
View Full Document