Steve McConnell Quote
Here's a summary of when to use inheritance and when to use containment: If multiple classes share common data but not behavior, create a common object that those classes can contain. If multiple classes share common behavior but not data, derive them from a common base class that defines the common routines. If multiple classes share common data and behavior, inherit from a common base class that defines the common data and routines. Inherit when you want the base class to control your interface; contain when you want to control your interface.
Steve McConnell
Here's a summary of when to use inheritance and when to use containment: If multiple classes share common data but not behavior, create a common object that those classes can contain. If multiple classes share common behavior but not data, derive them from a common base class that defines the common routines. If multiple classes share common data and behavior, inherit from a common base class that defines the common data and routines. Inherit when you want the base class to control your interface; contain when you want to control your interface.
Related Quotes
People accuse me of falling in love easily. It just means that I'm able to see the beauty in most of the people who cross paths with me and I appreciate it for what it is and also for what it isn't. L...
Ashly Lorenzana
Tags:
beauty, falling in love, flaws, imperfection, loneliness, love, passion, people, souls, strength
About Steve McConnell
Steven C. McConnell is an author of software engineering textbooks such as Code Complete, Rapid Development, and Software Estimation. He is cited as an expert in software engineering and project management.