Book description
Upon completion of an object-oriented design, you are faced with a troubling question: "Is it good, bad, or somewhere in between?" Seasoned experts often answer this question by subjecting the design to a subconscious list of guidelines based on their years of experience. Experienced developer Arthur J. Riel has captured this elusive, subconscious list, and in doing so, has provided a set of metrics that help determine the quality of object-oriented models.
Object-Oriented Design Heuristics offers insight into object-oriented design improvement. The more than sixty guidelines presented in this book are language-independent and allow you to rate the integrity of a software design. The heuristics are not written as hard and fast rules; they are meant to serve as warning mechanisms which allow the flexibility of ignoring the heuristic as necessary. This tutorial-based approach, born out of the author's extensive experience developing software, teaching thousands of students, and critiquing designs in a variety of domains, allows you to apply the guidelines in a personalized manner.
The heuristics cover important topics ranging from classes and objects (with emphasis on their relationships including association, uses, containment, and both single and multiple inheritance) to physical object-oriented design. You will gain an understanding of the synergy that exists between design heuristics and the popular concept of design patterns; heuristics can highlight a problem in one facet of a design while patterns can provide the solution.
Programmers of all levels will find value in this book. The
newcomer will discover a fast track to understanding the concepts
of object-oriented programming. At the same time, experienced
programmers seeking to strengthen their object-oriented development
efforts will appreciate the insightful analysis. In short, with
Object-Oriented Design Heuristics as your guide, you have
the tools to become a better software developer.
020163385XB04062001
Table of contents
- Copyright
- Preface
- Acknowledgements
-
1. The Motivation for Object-Oriented Programming
- 1.1. Revolutionists, Evolutionists, and the Object-Oriented Paradigm
- 1.2. Accidental Versus Essential Complexity à la Frederick Brooks
- 1.3. The Waterfall Model
- 1.4. The Iterative Model
- 1.5. Same- Versus Different-Language Prototyping
- 1.6. Software Reusability
- 1.7. Corporate Hierarchies of Good Designers
- Glossary of Terms
- 2. Classes and Objects: The Building Blocks of the Object-Oriented Paradigm
-
3. Topologies of Action-Oriented Versus Object-Oriented Applications
- 3.1. Differences in Application Topologies
- 3.2. When the Action-Oriented Paradigm Goes Right
- 3.3. The God Class Problem (Behavioral Form)
- 3.4. Another Example of Poor System Intelligence Distribution
- 3.5. The God Class Problem (Data Form)
- 3.6. The Proliferation of Classes Problem
- 3.7. The Role of Agent Classes
- 3.8. Examining the Use of Separate Entity and Controller Classes
- Glossary of Terms
- Summary of Heuristics
-
4. The Relationships Between Classes and Objects
- 4.1. Introduction to Class and Object Relationships
- 4.2. The Uses Relationship
- 4.3. Six Different Ways to Implement the Uses Relationship
- 4.4. Heuristics for the Uses Relationship
- 4.5. Refining the Amount of Collaboration Between Two Classes
- 4.6. The Containment Relationship
- 4.7. Semantic Constraints Between Classes
- 4.8. Attributes Versus Contained Classes
- 4.9. More Containment Heuristics
- 4.10. A Relationship Between Uses and Containment?
- 4.11. Containment by Value Versus Containment by Reference
- Glossary of Terms
- Summary of Heuristics
-
5. The Inheritance Relationship
- 5.1. Introduction to the Inheritance Relationship
- 5.2. Overriding Base Class Methods in Derived Classes
- 5.3. The Use of the Protected Section of a Base Class
- 5.4. The Width and Depth of Inheritance Hierarchies
- 5.5. Private, Protected, and Public Inheritance à la C+ +
- 5.6. A Real-World Example of Specialization
- 5.7. Heuristics That Trade Off Design Complexity and Flexibility
- 5.8. A Real-World Example of Generalization
- 5.9. The Mechanism of Polymorphism
- 5.10. A Problem with the Use of Inheritance as a Reusability Mechanism
- 5.11. An Inheritance Solution to an Interrupt-Driven Architecture
- 5.12. Inheritance Hierarchies Versus Attributes
- 5.13. The Confusion of the Need for Inheritance Versus an Object's Dynamic Semantics
- 5.14. Using Inheritance to Hide the Representation of a Class
- 5.15. Mistaking Objects for Derived Classes
- 5.16. Mistaking Object Generalization for the Need to Build Classes at Runtime
- 5.17. The Attempt to NOP a Base Class Method in Its Derived Class(es)
- 5.18. The Implementation of Optional Parts of Objects
- 5.19. A Problem with No Optimal Solution
- 5.20. Reusing Components Versus Reusing Frameworks
- Glossary
- Summary of Heuristics
-
6. Multiple Inheritance
- 6.1. Introduction to Multiple Inheritance
- 6.2. The Common Misuse of Multiple Inheritance
- 6.3. A Valid Use of Multiple Inheritance
- 6.4. Accidental Complexity In Languages That Do Not Support Multiple Inheritance
- 6.5. Frameworks That Incorporate Multiple Inheritance
- 6.6. The Use of Multiple Inheritance in the Design of Mixins
- 6.7. DAG Multiple Inheritance
- 6.8. Accidental DAG Multiple Inheritance via Poor Implementation of Optional Containment
- Glossary
- Heuristics Summary
- 7. The Association Relationship
-
8. Class-Specific Data and Behavior
- 8.1. Introduction to Class-Specific Versus Object-Specific Data and Behavior
- 8.2. Using Metaclasses to Capture Class-Specific Data and Behavior
- 8.3. Using Language-Level Keywords to Implement Class-Versus Object-Specific Data and Behavior
- 8.4. Metaclasses à la C++
- 8.5. A Useful Abstract Class That Is Not a Base Class?
- Glossary
- Heuristics Summary
-
9. Physical Object-Oriented Design
- 9.1. The Role of Logical and Physical Object-Oriented Design
- 9.2. The Construction of Object-Oriented Wrappers
- 9.3. Persistence in an Object-Oriented System
- 9.4. Memory Management Issues in an Object-Oriented Application
- 9.5. Minimal Public Interfaces for Reusable Components
- 9.6. Implementing Safe Shallow Copies
- 9.7. Concurrent Object-Oriented Programming
- 9.8. Implementing Object-Oriented Designs in Nonobject-Oriented Languages
- Glossary
- Summary of Heuristics
-
10. The Relationship Between Heuristics and Patterns
- 10.1. Heuristics Versus Patterns
- 10.2. Transitivity Among Design Transformation Patterns
- 10.3. The Reflexive Property of Design Transformation Patterns
- 10.4. Other Design Transformation Patterns
- 10.5. Future Research
-
11. The Use of Heuristics in Object-Oriented Design
- 11.1. The ATM Problem
- 11.2. Choosing a Methodology
- 11.3. A First Attempt at Producing an Object Model for the ATM
- 11.4. Adding Behavior to Our Object Model
- 11.5. Explicit Case Analysis Due to Accidental Complexity
- 11.6. Messaging Objects in Different Address Spaces
- 11.7. The Processing of the Transaction
- 11.8. Returning to the Domain of the ATM
- 11.9. Other Miscellaneous Issues
- 11.10. Conclusion
-
A. Heuristics Summary
- Chapter 2 Classes and Objects: The Building Blocks of the Object-Oriented Paradigm
- Chapter 3 Topologies of Action-Oriented Versus Object-Oriented Applications
- Chapter 4 The Relationships Between Classes and Objects
- Chapter 5 The Inheritance Relationship
- Chapter 6 Multiple Inheritance
- Chapter 7 The Association Relationship
- Chapter 8 Class-Specific Data and Behavior
- Chapter 9 Physical Object-Oriented Design
-
B. The Prevention of Memory Leakage
- Leak #1
- Example Code for Leak #1
- Leak #2
- Example Code for Leak #2
- Leak #3
- Example Code for Leak #3
- Leak #4
- Example Code for Leak #4
- Leak #5
- Example Code for Leak #5
- Leak #6
- Example Code for Leak #6
- Leak #7
- Returning a Reference to a Stack Object
- Returning an Internal Static Object Reference
- Returning a Memory Leaking Dynamically Allocated Object
- Correct Method for Leak #7
- Leak #8
- Code Example for Memory Leakage #8
-
C. Selected C++ Examples
- Selected C++ Example #2
- Selected C++ Example #4
- Selected C++ Example #5
- Selected C++ Example #9
- Selected C++ Example #10
- Selected C++ Example #15
- Selected C++ Example #17
- Selected C++ Example #18
- Selected C++ Example #19
- Selected C++ Example #20
- Selected C++ Example #21
- The ATM Side of the Application
- The Atm.hpp File
- The Atm.cpp File
- The Bank Side of the Application
- The Bank.hpp File
- The Bank.cpp File
- The Common Classes
- The Trans.hpp File
- The Trans.cpp File
- The Network.hpp File
- The Network.cpp File
- Bibliography
- Other Books Used for Reference in This Text
Product information
- Title: Object-Oriented Design Heuristics
- Author(s):
- Release date: April 1996
- Publisher(s): Addison-Wesley Professional
- ISBN: 9780201633856
You might also like
book
Design Patterns Explained: A New Perspective on Object-Oriented Design, Second Edition
"One of the great things about the book is the way the authors explain concepts very …
book
Refactoring for Software Design Smells
Awareness of design smells – indicators of common design problems – helps developers or software engineers …
book
Object-Oriented Design with ABAP: A Practical Approach
Conquer your fear and anxiety learning how the concepts behind object-oriented design apply to the ABAP …
book
Refactoring: Ruby Edition
The Definitive Refactoring Guide, Fully Revamped for Ruby With refactoring, programmers can transform even the most …