Hello,
I am having little design problem: I have one factory which will create object of with one type or another type. But my client requirement is to give(feed) the data(via setter methods) from outside world to the concrete class of type-1 not for type-2.
If I place these setter methods in interface, those need to be implemented forcefully both of concrete classes. This is NOT my requirement. I want to feed 1 kind of data for 1st type(some setters) and want to give another kind of data for other type(probably different setters other than which's contained by previous type.)
e.g
class ISubjectExecutor
{
public:
virtual void ISUBJECTEXECUTOR_EXPORTS_API Execute()=0;
};
class COMExecutor: public ISubjectExecutor
{
public:
virtual void Execute()=0;
void setCLSID();
void setGuids();
};
class Win32Executor : public IWin32Executor
{
public:
virtual void Execute()=0;
void setFilePath();
};
Now here I can't use pointer of ISubjectExecutor (*pSubjectExecutor) to call setter methods of Win32Executor or COMExecutor on my choice at any time after reciving pointer(ISubjectExecutor) from factory. Because those all setters never exist inside ISubjectExecutor interface, and you can't access any method which's never contained inside interface and exist in concrete implementation.
How to tackle this design problem to solve.?
Regards Hassan