If it is likely that the class implements IA and IB , and this fact makes conceptual sense for the problem area in which you are working, just use IAB , like this
interface IAB extends IA, IB { }
Determine if it makes sense in your case, it can be as simple as asking yourself what would be a good name for IAB? If you can find a satisfactory answer to this question, you can simply add this interface. If not, then the right place for your two
thisClassImGonnaUse.doSomething(); thisClassImGonnaUse.doSomethingToo();
is the FooA or FooB (or the base class of the two). This way, you donβt need to take any action or guess about the nature of the classes that implement your interfaces (which may become invalid or difficult to process later).
Waldheinz
source share