TITLE: another interpretation of mixin inheritance PROBLEM: <4am53j$eht@netlab.cs.rpi.edu> A mixin is an abstract class that represents a specific interface and is used to build up larger interfaces. Take for example the interfaces 'ReadAble' and 'WriteAble' represented by the classes: RESPONSE: stuart@bmsi.com (Stuart D. Gathman), 20 Dec 95 I guess the definition varies. What you call mixins, I have always called multiple inheritance - objects that comform to more than one interface. What I call mixins are partial implementations of a single interface. You can quickly build a complete object without writing any methods by combining packages of prewritten methods. This explanation and example is much simpler than Max Skallers (though not exploring all the nuances), so I believe that c.l.c++.m readers may benefit. [ I'll repost some of Skaller's stuff in the near future. -adc ] E.g. // interface struct SerialInterface { int read(char *buf,int) = 0; int write(const char *buf,int) = 0; }; // partial implementations struct BufferedRead: virtual public SerialInterface{ int read(char *buf,int); }; struct PolledRead: virtual public SerialInterface{ int read(char *buf,int); }; struct BufferedWrite: virtual public SerialInterface{ int write(const char *buf,int); }; struct PolledWrite: virtual public SerialInterface{ int write(const char *buf,int); }; // finally, the application creates a customized SerialInterface // without writing any code: struct MyComm: BufferedRead, PolledWrite { }; MyComm com1; com1.read(buf,buflen); // reads are interrupt driven com1.write(buf,buflen); // writes are polled