• Object-Oriented Design Heuristics
  • Table of Contents
  • Copyright
  • Preface
  • Acknowledgements
  • Chapter 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
  • Chapter 2. Classes and Objects: The Building Blocks of the Object-Oriented Paradigm
    • 2.1 Introduction to Classes and Objects
    • 2.2 Messages and Methods
    • 2.3 Class Coupling and Cohesion
    • 2.4 Dynamic Semantics
    • 2.5 Abstract Classes
    • 2.6 Roles Versus Classes
    • Glossary of Terms
    • Summary of Heuristics
  • Chapter 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
  • Chapter 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
  • Chapter 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
  • Chapter 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
  • Chapter 7. The Association Relationship
    • 7.1 Introduction to Association
    • 7.2 Associations Implemented Through a Referential Attribute
    • 7.3 Association Implemented Through a Third-Party Class
    • 7.4 Deciding Between a Containment and an Association Relationship
    • Glossary
    • Heuristics Summary
  • Chapter 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
  • Chapter 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
  • Chapter 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
  • Chapter 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
  • Appendix 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
  • Appendix 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
  • Appendix 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