Using MixIn vs Inheritance

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Benny the Guard
    New Member
    • Jun 2007
    • 92

    Using MixIn vs Inheritance

    Working on a new design and encountering some in my group who suggest creating a bunch of MixIn classes and combining them in and others who are suggesting a more classic approach of having a base class for the common functionality and then derving for specific use cases. As I see it for Mixins to be effective and useful one should:

    a) MixIns should provide an interface but NO data storage (after all MixIns storing data may clobber data in others)
    b) To be useful over normal derivation, we should see a need for multiple combinations, that is loose coupling

    Does this sound about right? Any other 'rules of thumb' for when to use mixins vs regular/simple inheritance?
Working...