Dofactory.com
Dofactory.com
 Back to list
Views:   5.6K
Replies:  0
Archived

Refactoring: Replace Inheritance by Delegation

I read that in the Refactoring literature that one of its approaches is to replace Inheritance by Delegation.  Supposedly, when using inheritance it is more difficult to make changes.  From experience I see that this is indeed the case.

However, if you look at for example WPF class libraries you'll find an inheritance tree that is incredibly deep and complex; sometimes up to 10-12 levels deep. 

My question is this: why is it that Microsoft does it this way and not use delegation more frequently?

Henry Wong, Mar 31, 2011
Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Cookies       Do Not Sell       Licensing      
Made with    in Austin, Texas.  - vsn 44.0.0
© Data & Object Factory, LLC.