Factor implementation differences into subcomponents

From CSSEMediaWiki
(Difference between revisions)
Jump to: navigation, search
(Simple explanation)
 
m
Line 5: Line 5:
 
This means that multiple subclasses can contain the same implementation without repeated code.
 
This means that multiple subclasses can contain the same implementation without repeated code.
  
 +
== Example ==
 +
 +
To do.
  
 
== See Also ==
 
== See Also ==

Revision as of 23:26, 12 August 2008

This is Rule 10 in Johnson and Foote 1988.

If different subclasses implement a method in one of a few ways, then the method may not be directly related to the superclass and the implementation should be separated by creating a class hierarchy and composing it within the superclass.

This means that multiple subclasses can contain the same implementation without repeated code.

Example

To do.

See Also

Personal tools