Presentation is loading. Please wait.

Presentation is loading. Please wait.

© M.E. Fayad 1995-2006 SJSU -- CmpE Analysis Heuristics Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College of Engineering San.

Similar presentations


Presentation on theme: "© M.E. Fayad 1995-2006 SJSU -- CmpE Analysis Heuristics Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College of Engineering San."— Presentation transcript:

1 © M.E. Fayad 1995-2006 SJSU -- CmpE Analysis Heuristics Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College of Engineering San José State University One Washington Square San José, CA 95192-0180 http://www.engr.sjsu.edu/~fayad

2 L5-S2Analysis Heuristics © M.E. Fayad 1996-2006 SJSU – CmpE M.E. Fayad 2 Lesson 5: Analysis Heuristics

3 L5-S3Analysis Heuristics © M.E. Fayad 1996-2006 SJSU – CmpE M.E. Fayad Lesson Objectives 3 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”

4 L5-S4Analysis Heuristics © M.E. Fayad 1996-2006 SJSU – CmpE M.E. Fayad RA Design Code Test Deploy 4 Overview: Life Cycle What How Build Test Use What is the customer really wants? How – the best solution How do we construct (implement) the system Test - 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?

5 L5-S5Analysis Heuristics © M.E. Fayad 1996-2006 SJSU – CmpE M.E. Fayad AnalysisDesign What is the problem?How to solve the problem? Problem SpaceSolution Space Mostly “one” ProblemMany Solutions 5 Overview: Analysis vs. Design

6 L5-S6Analysis Heuristics © M.E. Fayad 1996-2006 SJSU – CmpE M.E. Fayad Practical Concrete Action Can be measured Repeatable Tailorable Must be documented Hierarchical Specify who, what, when, how and ignore the why? 6 Overview: Process Properties

7 L5-S7Analysis Heuristics © M.E. Fayad 1996-2006 SJSU – CmpE M.E. Fayad Simple Complete (most likely to be correct) Stable to technological changes Testable Easy to understand Visual or graphical 7 Overview: Model Properties

8 L5-S8Analysis Heuristics © M.E. Fayad 1996-2006 SJSU – CmpE M.E. Fayad A 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?” 8 Heuristic #1: Go Beyond the Problem Domain

9 L5-S9Analysis Heuristics © M.E. Fayad 1996-2006 SJSU – CmpE M.E. Fayad Build these into the analysis model Developing an adaptable architecture does not happen just because you are using OOD and/or C++ (any more than extensibility or reuse occur automatically) 9 Heuristic #1: Go Beyond the Problem Domain Generalize Early & Generalize Vigorously

10 L5-S10Analysis Heuristics © M.E. Fayad 1996-2006 SJSU – CmpE M.E. Fayad The “Real World” is the best model of today but it only hints at what tomorrow will bring Basic for speculation –Changing user requirements –Changing customer base –Competitive products –changing technology 10 Heuristic #2: Speculate About Likely Changes

11 L5-S11Analysis Heuristics © M.E. Fayad 1996-2006 SJSU – CmpE M.E. Fayad Build the analysis model so it can adapt to these likely changes You 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 Patterns 11 Heuristic #2: Speculate About Likely Changes

12 L5-S12Analysis Heuristics © M.E. Fayad 1996-2006 SJSU – CmpE M.E. Fayad Place 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 policy 12 Heuristic #3: Separate General Functionality from Specific Policy

13 L5-S13Analysis Heuristics © M.E. Fayad 1996-2006 SJSU – CmpE M.E. Fayad Conservation 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. 13 Heuristic #3: Separate General Functionality from Specific Policy Mechanism Rich & Policy Free

14 L5-S14Analysis Heuristics © M.E. Fayad 1996-2006 SJSU – CmpE M.E. Fayad 14 Heuristic #3: Illustrated Example – The Problem Forms State Tax Federal Tax File System Calculator

15 L5-S15Analysis Heuristics © M.E. Fayad 1996-2006 SJSU – CmpE M.E. Fayad 15 Heuristic #3: Illustrated Example – The Solution Forms State Tax Federal Tax File System Calculator MRPF MRP+ MRPR

16 L5-S16Analysis Heuristics © M.E. Fayad 1996-2006 SJSU – CmpE M.E. Fayad In 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. 16 Heuristic #4: Objects Should Have Cohesive Interfaces

17 L5-S17Analysis Heuristics © M.E. Fayad 1996-2006 SJSU – CmpE M.E. Fayad It 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 reusable 17 Heuristic #4: Objects Should Have Cohesive Interfaces Do One Thing

18 L5-S18Analysis Heuristics © M.E. Fayad 1996-2006 SJSU – CmpE M.E. Fayad Intelligent (Responsible) Objects Incorporate important knowledge Incorporate knowledge that is difficult to produce, find, or replicate Know how to synthesize knowledge 18 Heuristic #5: Objects Should Intelligent Agents

19 L5-S19Analysis Heuristics © M.E. Fayad 1996-2006 SJSU – CmpE M.E. Fayad Agents are capable of (limited) autonomous behavior Know that they are supposed to do, and they do. Work best with limited supervision. Adapt to their environment Know how to delegate work to other objects 19 Heuristic #5: Objects Should Intelligent Agents

20 L5-S20Analysis Heuristics © M.E. Fayad 1996-2006 SJSU – CmpE M.E. Fayad Agents are capable of (limited) autonomous behavior Know how to find objects to which they can delegate work Have the information they need or know where to get the information or know where to get information on getting information or can interpret information given to them. Are highly adaptable, extensible, and reusable Are expensive to design and build 20 Heuristic #5: Objects Should Intelligent Agents

21 L5-S21Analysis Heuristics © M.E. Fayad 1996-2006 SJSU – CmpE M.E. Fayad Objects that only export attributes or data must be manipulated by clients. (aka. “dead data”) Objects that only export basic operations require clients to direct and supervise all activity (aka. “stupid objects”) Objects that export services make life easier for their clients: –Server selects the best way to perform the service –Server finds and manages the resources 21 Heuristic #6: Objects Should Export Services

22 L5-S22Analysis Heuristics © M.E. Fayad 1996-2006 SJSU – CmpE M.E. Fayad Services should define “What” not “How” –Can “Drive to Work” be replaced by “Get to Work” –Enhances extensibility –Enhances reusability –Distributes intelligence 22 Heuristic #6: Objects Should Export Services Move Complexity From the Clients to the Servers

23 L5-S23Analysis Heuristics © M.E. Fayad 1996-2006 SJSU – CmpE M.E. Fayad 23 Heuristic #6: Stack Example Type Stack push ( ) pop ( ) length ( ) empty ( ) full ( ) Stack Implementations Stack Interfaces

24 L5-S24Analysis Heuristics © M.E. Fayad 1996-2006 SJSU – CmpE M.E. Fayad Object machismo –Equating the value of an object with how big and/or complex it is (e.g., Lines of Code, # of methods, or complexity of algorithms it uses). –Macho objects tend to be central controllers that are difficult to design, difficult to understand, have to much policy, are hard to extend, and low reuse potential. 24 Heuristic #7: Avoid “Object Machismo”

25 L5-S25Analysis Heuristics © M.E. Fayad 1996-2006 SJSU – CmpE M.E. Fayad The value of an object is based on many factors Does it do something useful Does it have a simple and clean interface Does it have well-specific behavior Does it model an essential quality of the system Can it be composed with other objects to perform more complex tasks. 25 Heuristic #7: Avoid “Object Machismo”

26 L5-S26Analysis Heuristics © M.E. Fayad 1996-2006 SJSU – CmpE M.E. Fayad The value of an object is also based on other objects: –An object perfectly suited for one model may be totally wrong in another model –The object must be placed in context to see whether or not it is a good and valuable object. 26 Heuristic #7: Avoid “Object Machismo” A Valuable Object Works and Plays Well with Others.

27 L5-S27Analysis Heuristics © M.E. Fayad 1996-2006 SJSU – CmpE M.E. Fayad Explain the following statements: 1. Objects should be intelligent agents 2. Mechanism rich and policy free 3. A valuable object works and plays well with others 4. Analysis model should not be too elaborate or too formal Explain how to build an analysis model Explain how do you make the analysis model more adaptable Essay Topic: Analysis Guidelines 27 Discussion Questions


Download ppt "© M.E. Fayad 1995-2006 SJSU -- CmpE Analysis Heuristics Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College of Engineering San."

Similar presentations


Ads by Google