DOC PREVIEW
SJSU CMPE 133 - Object-Oriented Design Heuristics

This preview shows page 1-2-3-4-5-6 out of 19 pages.

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

Unformatted text preview:

Software System EngineeringSlide 2Slide 3CRC CardsSlide 5GuidelinesObject-Oriented Design HeuristicsSlide 8Design Patterns: Properties & DefinitionsDesign Patterns: More Properties & DefinitionsSlide 11Slide 12Slide 13Slide 14Slide 15Slide 16Slide 17Discussion QuestionsQuestions for the Next Lecture© 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-1-S2 Design Heuristics - 12Lesson 6-1:Object-Oriented Design Heuristics© M.E. Fayad 1997-2006SJSU – CmpE M.E. Fayad L6-1-S3 Design Heuristics - 1 Lesson ObjectivesObjectives3 Overview of Previous Lecture  Understand what do we mean by heuristics Understand what is an object-oriented design heuristic? Discuss the following:– Macho Class Problem– Interesting Design Problems– Topology Which Needs Accessor Methods– The Common Traps of Controller Classes© M.E. Fayad 1997-2006SJSU – CmpE M.E. Fayad L6-1-S4 Design Heuristics - 14CRC CardsGeneral –Each class is described on a separate 3X5 or 4X6 cardThe cards are known as CRC card. They have 3 sections:–Class–Responsibilities–CollaborationsATM (role)ResponsibilityCollaborationClients ServerAccess & modify account balance Account Balance Inquiry Deposit Transaction Funds Transfer Withdrawal Transaction© M.E. Fayad 1997-2006SJSU – CmpE M.E. Fayad L6-1-S5 Design Heuristics - 1Class Name (role (2)) - XResponsibilityCollaborationClients Server1. Unique 2. One Responsibility3. Within Context4. Indicate the role of the classThe clients of the named class (X)•4-5 interfaces•Services provided by the named class(X)(1)(5)(4)(3)5Other Names:InterfacesCommandsRequestsFunctionsMethodsProceduresProcessesWhat are the good, bad, and ugly of the CRC cards?© M.E. Fayad 1997-2006SJSU – CmpE M.E. Fayad L6-1-S6 Design Heuristics - 1Pre- & Post-conditionsStatements that guide you to do something.It is not a process.It is not a standards.It is not a methodologyIt is not a heuristic.Direction or information about something.6Guidelines© M.E. Fayad 1997-2006SJSU – CmpE M.E. Fayad L6-1-S7 Design Heuristics - 1An OO design heuristic is a “rule-of-thumb”, not a rule.An OO design heuristic is something which makes a design “feel right” to its designer.An OO design heuristic is used to guide a designer in selecting the appropriate design choice from many possibilities.An OO design heuristic warns the designer of some impending doom when it is violated.7Object-Oriented Design Heuristics© M.E. Fayad 1997-2006SJSU – CmpE M.E. Fayad L6-1-S8 Design Heuristics - 1While some design heuristic certainly imply a sense of priority, there cannot be a prioritized ordering of the entire list (in general). It is not possible to follow all heuristics in a design. They frequently have colliding interests such as extensibility versus complexity.A design heuristic will tell users of design patterns when a particular pattern needs to be applied.8Object-Oriented Design Heuristics© M.E. Fayad 1997-2006SJSU – CmpE M.E. Fayad L6-1-S9 Design Heuristics - 1[Webster] A pattern is a fully realized form, original, or model accepted, or proposed for imitation.[Webster] A pattern is something regarded as normative example to be copied; archetype ; exemplar .[Alexander 79] A pattern is a solution to a problem in a context.[Alexander 79] A pattern has three parts:–Problem(s)–Context–SolutionA pattern offers a workable solutions.Patterns are rules of thumbs that can be used again and again -- useful, practical “how-to” guideline.9Design Patterns: Properties & Definitions© M.E. Fayad 1997-2006SJSU – CmpE M.E. Fayad L6-1-S10 Design Heuristics - 1[Gamma 95.] Design patterns identify, name, and describe common and recurring designs appearing frequently in object-oriented systems.[Gamma 95] You can think of a design pattern as a micro architecture that contributes to overall system architecture.Each design pattern tends to be relatively small in size and scope.[Coplien 92] Patterns are a way of describing, documenting, and creating system architectures for software.Patterns tend not to be domain specific.Patterns are one of the primary mechanisms that people use for passing on expertise to others.10Design Patterns: More Properties & Definitions© M.E. Fayad 1997-2006SJSU – CmpE M.E. Fayad L6-1-S11 Design Heuristics - 1Heuristic Properties:–A heuristic is a “rule-of-thumb but not a rule.–Heuristics attempt to capture the unknown “feels right” feature of good analysis, good design, good documentation, etc.–Heuristics are strongly related to patterns in that they provide the rational for improving a design from a worse pattern to a better one.–All of the interesting heuristics are qualitative in nature.–There are no useful quantitative heuristics11Object-Oriented Design Heuristics© M.E. Fayad 1997-2006SJSU – CmpE M.E. Fayad L6-1-S12 Design Heuristics - 1The absence of quantitative heuristics leads us to conclude that OO design is not precise.Some amount of fuzziness is required and only qualitative heuristics can accommodate this constraints.For an example of this fuzziness consider the following two important design heuristics that play off each other in an attempt to model the top level view of a system–A designer should distribute system intelligence uniformly among the top level classes in the system–A designer should minimize the number of collaborations on the top level of the system. 12Object-Oriented Design Heuristics© M.E. Fayad 1997-2006SJSU – CmpE M.E. Fayad L6-1-S13 Design Heuristics - 1It is typical for designers to want the seemingly more useful quantitative metrics such as–A designer should have 4.6 top level classes per 1,000 lines of code.–A designer should have 35 to 45 percent of the relationships in a design be uses relationships.These heuristic are not useful and very misleading.13Object-Oriented Design Heuristics© M.E. Fayad 1997-2006SJSU – CmpE M.E. Fayad L6-1-S14 Design Heuristics - 1What is an Object?An object will always have four facets:1. Identity (this might be only its


View Full Document

SJSU CMPE 133 - Object-Oriented Design Heuristics

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