I have a MainBaseClass
that implements two interfaces, IInterfaceA
and IInterfaceB
.
The problem here is that derived classes either need the implementation of IInterfaceA
only, or IInterfaceB
only.
Currently, all classes that inherit from MainBaseClass
will have exposure to both implementations.
I would like for those classes that don’t need the implementation of IInterfaceA
to not have any exposure to such implementation. The same thing applies to classes that consume the implementation of IInterfaceA
, shouldn’t have exposure to the implementation of IInterfaceB
.
Restrictions:
- Solve this problem without introducing any other Base classes.
- Derived classes cannot implement those interfaces themselves.