Replace Inheritance with Delegation

From CSSEMediaWiki
(Difference between revisions)
Jump to: navigation, search
(New page: Straight from Martin Fowler 2003: "A subclass uses only part of a superclasses interface or does not want to inherit data. ''Create a field for the superclass, adjust methods to dele...)
 
m (Reverted edits by Ebybymic (Talk); changed back to last version by Joey Scarr)
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
Straight from [[Martin Fowler 2003]]:
+
Straight from [[Martin Fowler 1999]]:
  
 
"A subclass uses only part of a superclasses interface or does not want to inherit data.
 
"A subclass uses only part of a superclasses interface or does not want to inherit data.
Line 7: Line 7:
 
==See Also==
 
==See Also==
  
[[Don't burn your base class]]
+
*[[Delegation]]
 +
*[[Don't burn your base class]]
 +
*[[Avoid inheritance for implementation]]

Latest revision as of 03:21, 25 November 2010

Straight from Martin Fowler 1999:

"A subclass uses only part of a superclasses interface or does not want to inherit data.

Create a field for the superclass, adjust methods to delegate to the super class, and remove the subclassing."

See Also

Personal tools