I have various interfaces i have to implement. Let's assume ITypeA, ITypeB. They have following methods:
ITypeA
Connect
Disconnect
GetData
SetData
ClearData
ITypeB
Connect
Disconnect
GetData
SetData
Start
Pause
Stop
They have some base functionality: Connect
, Disconnect
, GetData
and SetData
. If I want to add ITypeC in the future, it will have these base functionality too.
I want to access to the base functionality and if there is additional functionality, I want to get this too. What design patterns are available that are capable of this situations?
I found one here: Extension Interface. In this, you create a base interface and multiple extension interfaces that are implementing the additional functions. In the base interface you can ask for the available extension interfaces of the component. But this approach seems complicated: I have to create interfaces for each type, factories for the interfaces, I need some tables to save what Interface belongs to what Factory...
What is the basic solution for this problem? Extension Interfaces? Are there any other possible alternatives for my problem?