Design-Issue: Is-A-Modelling does not fit
Dear gurus,
I have a design problem and I try to describe it as short as possible.
a)
I have an application which needs different sources for images: e.g. from an avi-file, from a frame-grabber_1, from a frame-grabber_2, .....
b)
This seems to be a real 100% "is-a modeling", so I created a base-class CInput and from that I inherited CAvi, CFrameGrabber_1, CFrameGrabber_2,....
c)
The interface is something like that:
CImg *pImg CInput::pleaseGiveMeAnImage();
d)
It works phantastic. Each client of this code uses CInput only.
BUT: Now the problem begins
1)
A framegrabber is only a "real CInput" if I want to have images
2a)
If I want to configure my different CInput's, I need access to internal data-structures (e.g. a structure with 100 entries) and that are totaly different between the different inputs
2b)
Another typical problem is the adjustment of brightness, which does not make sense on an avi
3)
This issues (2a, 2b) do not fit into my design of "Is-a-modelling" with public inheritance. It seems that only a part of my design fits to the nees of reality.
My Question:
Does anybody have an idea how to solve this design-problem in an elegant way?
Thank you
Tomerland