The "code to interfaces" is not an official
pattern, but it is an advice that I have seen in many books. I have a specific situation where I wonder if the "code to interface" can still be used.
The situation:
I have 3 interfaces implemented by 3 classes. These interfaces are very similar, meaning some methods are shared in all interfaces, some methods have a small difference (e.g. in one argument) and some are only in one interface and not in the others.
My question is, what is the best way, if any, to keep the "code to interface"
philosophy and reduce the number of interfaces.
If it is not possible, how will you proceed so that there is as less as possible code duplication? For example with asbstract classes?
Thank you in advance.