Analysis HeuristicsSlide 2Slide 3Overview: Life CycleOverview: Analysis vs. DesignOverview: Process PropertiesOverview: Model PropertiesHeuristic #1: Go Beyond the Problem DomainSlide 9Heuristic #2: Speculate About Likely ChangesSlide 11Heuristic #3: Separate General Functionality from Specific PolicySlide 13Heuristic #3: Illustrated Example – The ProblemHeuristic #3: Illustrated Example – The SolutionHeuristic #4: Objects Should Have Cohesive InterfacesSlide 17Heuristic #5: Objects Should Intelligent AgentsSlide 19Slide 20Heuristic #6: Objects Should Export ServicesSlide 22Heuristic #6: Stack ExampleHeuristic #7: Avoid “Object Machismo”Slide 25Slide 26Discussion Questions© M.E. Fayad 1995-2006SJSU -- CmpEAnalysis Heuristics Dr. M.E. Fayad, ProfessorComputer Engineering Department, Room #283I College of EngineeringSan José State UniversityOne Washington SquareSan José, CA 95192-0180 http://www.engr.sjsu.edu/~fayad© M.E. Fayad 1996-2006SJSU – CmpE M.E. Fayad L5-S2 Analysis Heuristics2Lesson 5:Analysis Heuristics© M.E. Fayad 1996-2006SJSU – CmpE M.E. Fayad L5-S3 Analysis Heuristics Lesson ObjectivesObjectives3 Overview of previous lectures. Understand the analysis heuristics–Go Beyond the Problem Domain–Speculate About Likely Changes–Separate General Functionality from Specific Policy–Object should have Cohesive Interfaces–Objects Should Be Intelligent Agents–Objects Should Export Services–Avoid “Object Machismo”© M.E. Fayad 1996-2006SJSU – CmpE M.E. Fayad L5-S4 Analysis HeuristicsRADesignCodeTestDeploy4Overview: Life CycleWhatHowBuildTestUseWhat is the customer really wants?How – the best solutionHow do we construct (implement) the systemTest - Are customer requirements testable?- Does the how logically follow from what?- Does the built system do what it is suppose to do?How do we enhance &/or repair the built system?© M.E. Fayad 1996-2006SJSU – CmpE M.E. Fayad L5-S5 Analysis HeuristicsAnalysis DesignWhat is the problem? How to solve the problem?Problem Space Solution SpaceMostly “one” Problem Many Solutions5Overview: Analysis vs. Design© M.E. Fayad 1996-2006SJSU – CmpE M.E. Fayad L5-S6 Analysis HeuristicsPracticalConcrete ActionCan be measuredRepeatableTailorableMust be documentedHierarchicalSpecify who, what, when, how and ignore the why?6Overview: Process Properties© M.E. Fayad 1996-2006SJSU – CmpE M.E. Fayad L5-S7 Analysis HeuristicsSimpleComplete (most likely to be correct)Stable to technological changesTestableEasy to understandVisual or graphical7Overview: Model Properties© M.E. Fayad 1996-2006SJSU – CmpE M.E. Fayad L5-S8 Analysis HeuristicsA system structure is based on the “Real World”, “locks in” today’s problem domain relationships.This makes it difficult to adapt the system to future requirements.Look for relationships and generalizations that transcend the current problem domain–Ask “What is it?”8Heuristic #1: Go Beyond the Problem Domain© M.E. Fayad 1996-2006SJSU – CmpE M.E. Fayad L5-S9 Analysis HeuristicsBuild these into the analysis modelDeveloping an adaptable architecture does not happen just because you are using OOD and/or C++ (any more than extensibility or reuse occur automatically)9Heuristic #1: Go Beyond the Problem Domain Generalize Early & Generalize Vigorously Generalize Early & Generalize Vigorously© M.E. Fayad 1996-2006SJSU – CmpE M.E. Fayad L5-S10 Analysis HeuristicsThe “Real World” is the best model of today but it only hints at what tomorrow will bringBasic for speculation–Changing user requirements–Changing customer base–Competitive products–changing technology10Heuristic #2: Speculate About Likely Changes© M.E. Fayad 1996-2006SJSU – CmpE M.E. Fayad L5-S11 Analysis HeuristicsBuild the analysis model so it can adapt to these likely changesYou do not have to be 100% correct.Developing an adaptable architecture does not happen just because you are using OOD and/or C++ (any more than extensibility or reuse occur automatically) – Exs: Hooks, HotSpots, Design Patterns11Heuristic #2: Speculate About Likely Changes© M.E. Fayad 1996-2006SJSU – CmpE M.E. Fayad L5-S12 Analysis HeuristicsPlace general functionality in entity objects (class)–Entity object (class) will now be more reusable.Place specific policy in control objects (active class)–Policy is localized so that it is easier to introduce changes to this policy12Heuristic #3: Separate General Functionality from Specific Policy© M.E. Fayad 1996-2006SJSU – CmpE M.E. Fayad L5-S13 Analysis HeuristicsConservation of Policy–There is no way to eliminate or ignore all policy–The policy will be in the delivered system–All we can do is structure the policy so that it is easy to adapt and change it.13Heuristic #3: Separate General Functionality from Specific Policy Mechanism Rich & Policy Free Mechanism Rich & Policy Free© M.E. Fayad 1996-2006SJSU – CmpE M.E. Fayad L5-S14 Analysis Heuristics14Heuristic #3: Illustrated Example – The ProblemFormsState TaxFederal TaxFile SystemCalculator© M.E. Fayad 1996-2006SJSU – CmpE M.E. Fayad L5-S15 Analysis Heuristics15Heuristic #3: Illustrated Example – The SolutionFormsState TaxFederal TaxFile SystemCalculatorMRPFMRPFMRP+MRPRMRPR© M.E. Fayad 1996-2006SJSU – CmpE M.E. Fayad L5-S16 Analysis HeuristicsIn the “Real World”, a remote Controller for home electronics may have 50 buttons for controlling your TV, VCR, Stereo , and others.Modeling this controller as a single, real-life object will not be adaptable to future changes.16Heuristic #4: Objects Should Have Cohesive Interfaces© M.E. Fayad 1996-2006SJSU – CmpE M.E. Fayad L5-S17 Analysis HeuristicsIt may be better to:–First model each different set of operations as a separate object with a strongly cohesive interface.–Model the combined functionality as a separate object that uses other objects.Result is more adaptable and reusable17Heuristic #4: Objects Should Have Cohesive Interfaces Do One Thing Do One Thing© M.E. Fayad 1996-2006SJSU – CmpE M.E. Fayad L5-S18 Analysis HeuristicsIntelligent (Responsible) ObjectsIncorporate important knowledgeIncorporate knowledge that is difficult to produce, find, or replicateKnow how to synthesize knowledge18Heuristic #5: Objects Should
View Full Document