Mixin class

This is a discussion on Mixin class within the C++ Programming forums, part of the General Programming Boards category; Need clarification please, Conceptually, not in practice, is a Mixin class supposed to augment the interface of another base class ...

  1. #1
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,579

    Mixin class

    Need clarification please,

    Conceptually, not in practice, is a Mixin class supposed to augment the interface of another base class or the leaf class deriving from them both?

    I understand the difference may be small on paper, since a Mixin only makes its purpose apparent through the leaf class which inherits both from its base and the Mixin. But conceptually I can also see the Mixin augmenting its sister base class interface with this.

    I'm having trouble understanding which is right?
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >is a Mixin class supposed to augment the interface of another base class or the leaf class deriving from them both?
    Conceptually you could go with either, though I think the latter is more intuitive.
    My best code is written with the delete key.

  3. #3
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,579
    > Conceptually you could go with either, though I think the latter is more intuitive.

    Thanks Prelude.
    So, it's possible to still call a Mixin a Mixin, if the sister base class is not an ABC, correct?

    EDIT: Scratch that. The answer seems to be obviously yes.
    Last edited by Mario F.; 11-12-2006 at 07:11 AM.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Class design problem
    By h3ro in forum C++ Programming
    Replies: 10
    Last Post: 12-19-2008, 09:10 AM
  2. Specializing class
    By Elysia in forum C++ Programming
    Replies: 6
    Last Post: 09-28-2008, 05:30 AM
  3. matrix class
    By shuo in forum C++ Programming
    Replies: 2
    Last Post: 07-13-2007, 02:03 AM
  4. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 03:39 PM
  5. Abstract class problem
    By VanJay011379 in forum C++ Programming
    Replies: 9
    Last Post: 07-31-2002, 02:30 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21