[Chicago-talk] 2 subclasses or Multiple inheritance

Jay Strauss me at heyjay.com
Fri Mar 19 23:03:06 CST 2004


I have a class which connects to Ameritrade (broker), and I have another
class which connects to InteractiveBrokers.  Both of these classes have
methods quote, connect, disconnect.  The class for InteractiveBrokers has a
bunch of others too.  While the method names are the same their
implementation is totally different, as are their required input parms.

The classes don't share any of the same code, and I don't see them sharing
any/much in the future.

I'd like to be able to plug in other brokers as necessary.

So my question is, do I make a base class like "broker" and make a
Ameritrade and InteractiveBrokers that inherit from broker, or do a make a
broker that inherits from Ameritrade and InteractiveBrokers?

Thanks
Jay




More information about the Chicago-talk mailing list