Quote from dcraig:
Just define a Broker and a separate Feed Interface. Implement both in a single Class for InteractiveBrokers (for example), or just implement Feed in eg OpenTick Class. Thats how I do it. I don't see any problems.
Multiple sessions to same broker ? Use arguments to Broker.connect (..). Maybe varargs (though I have never used it in Java).
Thanks for the input.
Agree, multiple interface implementation is the only sensible option. It means though that I have to factor out the connect(), disconnect() methods into a further interface. The connect(), disconnect() are common to both market data providers and brokerage providers.
So, I'm looking at something like:
IProvider
IMarketDataProvider
IBroker
IXXXXProvider
Looking at Rightedge reminded me that I should also probably think about historical data "providers" e.g.
IHistoricalDataProvider
The reason I was reluctant to go this route was due to the fact that for each "provider" interface, there will need to be a separate set of callback/handler interfaces e.g.
IProvider matches with IProviderHandler (methods such as onError(), onConnect(), onDisconnect())
IMarketDataProvider matches with IMarketDataHandler (methods such as onQuote(), onTrade())
etc.
I'll try and put this all in UML for easier comprehension and see what people think.