DOC PREVIEW
SJSU CMPE 133 - Object-Oriented Design Heuristics -2

This preview shows page 1-2-3-23-24-25-26-46-47-48 out of 48 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 48 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 48 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 48 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 48 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 48 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 48 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 48 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 48 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 48 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 48 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 48 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Software System EngineeringSlide 2Slide 3A Useful Analogy From Telephony (1)A Useful Analogy From Telephony (2)A Useful Analogy From Telephony (3)Comparison of Macho Class & Overly Distributed TopologiesThe Macho Class ProblemA Behavior Macho ClassA Data Structure Macho ClassSlide 11The Accessor Method Debate (1)The Accessor Method Debate (2)The Accessor Method Debate (3)The Accessor Method Debate (4)A Topology Which Needs Accessor MethodsThe Common Traps of Controller Classes (1)The Common Traps of Controller Classes (2)Controller Classes & the Migration of Legacy Systems (1)Controller Classes & the Migration of Legacy Systems (2)Controller Classes & the Migration of Legacy Systems (3)Controller Classes & the Migration of Legacy Systems (4)Controller Classes & Hiding Portions of Public Interface (1)Controller Classes & Hiding Portions of Public Interface (2)Controller Classes & Hiding Portions of Public Interface (3)Controller Classes & Hiding Portions of Public Interface (4)Controller Classes & Hiding Portions of Public Interface (5)Heuristics for Avoiding Macho Classes (1)Heuristics for Avoiding Macho Classes (2)The Proliferation of Classes Problem (1)The Proliferation of Classes Problem (2)The Proliferation of Classes Problem (3)The Proliferation of Classes Problem (4)The Proliferation of Classes Problem (5)The Proliferation of Classes Problem (6)The Proliferation of Classes Problem (7)The Proliferation of Classes Problem (8)The Proliferation of Classes Problem (9)The Proliferation of Classes Problem (10)The Proliferation of Classes Problem (11)The Proliferation of Classes Problem (12)The Proliferation of Classes Problem (13)The Proliferation of Classes Problem (14)The Proliferation of Classes Problem (15)The Proliferation of Classes Problem (16)The Proliferation of Classes Problem (17)Slide 47Discussion Questions© M.E. Fayad 1997-2006SJSU -- CmpESoftware System EngineeringDr. 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 1997-2006SJSU – CmpE M.E. Fayad L6-2-S2 Design Heuristics - 22Lesson 6-2:Object-Oriented Design Heuristics -2© M.E. Fayad 1997-2006SJSU – CmpE M.E. Fayad L6-2-S3 Design Heuristics - 2 Lesson ObjectivesObjectives3 Overview of Previous Lecture  Discuss the following:– Macho Class Problem– Interesting Design Problems– Topology Which Needs Accessor Methods– The Common Traps of Controller Classes– Many more!!!!© M.E. Fayad 1997-2006SJSU – CmpE M.E. Fayad L6-2-S4 Design Heuristics - 24A Useful Analogy From Telephony (1)When designing a telephone system for the United States we might suggest putting one big switch in Chicago and connecting every phone to it. (assume wire is free).The obvious problem is that if anything happens to Chicago, the entire phone system is down.We want to “distribute the system intelligence” for fault tolerance.© M.E. Fayad 1997-2006SJSU – CmpE M.E. Fayad L6-2-S5 Design Heuristics - 2Since we want to distribute the system intelligence let us propose a new phone system.We will connect each phone to every other phone in each of other houses.The obvious problem here is the complexity of the system is so great it prohibits us from adding a new phone.5A Useful Analogy From Telephony (2)© M.E. Fayad 1997-2006SJSU – CmpE M.E. Fayad L6-2-S6 Design Heuristics - 2We clearly want to distribute the system intelligence for fault tolerance, but not too much because it will add too much complexity.The same is true in OO design.Fortunately for telephony system there is the useful number of call density to determine how the distribution should take place. In this case, there is analogy in the domain of OO design.This leads us to two largest problems plaguing OO designers: the “Macho Class” Problem and the “Proliferation of Classes” Problem.6A Useful Analogy From Telephony (3)© M.E. Fayad 1997-2006SJSU – CmpE M.E. Fayad L6-2-S7 Design Heuristics - 27Comparison of Macho Class & Overly Distributed TopologiesMacho ClassOverly Distributed System© M.E. Fayad 1997-2006SJSU – CmpE M.E. Fayad L6-2-S8 Design Heuristics - 2A Behavior Macho ClassA Data Structure Macho Class8The Macho Class Problem© M.E. Fayad 1997-2006SJSU – CmpE M.E. Fayad L6-2-S9 Design Heuristics - 2The problem Occurs when a designer misses the centralized control mechanism of action-oriented paradigm and attempts to capture it in a class.The result is a central brain class talking via accessor methods (i, e. gets and sets) to a number of uninteresting data structures.9A Behavior Macho ClassMacho classclass5class1class2 class3 class4set_result()get_z()get_x()get_y()get_q()© M.E. Fayad 1997-2006SJSU – CmpE M.E. Fayad L6-2-S10 Design Heuristics - 2The problem Occurs when designers are migrating a legacy system to an OO application.The legacy system has a global data block being access by many of the system’s functions.The designers wrap the data structure in a class with an interface of accessor methods and then collect the functions into groups within controller classes10A Data Structure Macho ClassMacho classcontrollerclass1set_result()get_z()get_x()get_y()get_q()controllerclass2controllerclass3controllerclass4controllerclass5© M.E. Fayad 1997-2006SJSU – CmpE M.E. Fayad L6-2-S11 Design Heuristics - 2Legacy Systems: A DefinitionLegacy Software is any preexisting software that must be replaced by, incorporated into, or interfaced with software that is currently being developed. Legacy software is typically not OO and the use of legacy software on projects developing OO software can cause problems due to the impedance mismatch between different structures of the software. 11© M.E. Fayad 1997-2006SJSU – CmpE M.E. Fayad L6-2-S12 Design Heuristics - 2An accessor method is any relatively standard small and simple method that is used to either get or set the value of an instance attributeSynonyms: Accessing Method, Accessing Operation, Accessor Operation.Contrast with: Accessor Message or Accessing MessageAccessor Message is any message used to get or set the value of instance attribute.12The Accessor Method Debate (1)© M.E. Fayad 1997-2006SJSU – CmpE M.E. Fayad L6-2-S13 Design Heuristics - 2Examples


View Full Document

SJSU CMPE 133 - Object-Oriented Design Heuristics -2

Download Object-Oriented Design Heuristics -2
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 Object-Oriented Design Heuristics -2 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 Object-Oriented Design Heuristics -2 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?