3 ms·
Interfaces serve two roles: 1. They are (usually) concise specification/contract for the implementation to follow, and for the client to use. 2. They permit s
by Jtsummers 5y ago
Interfaces serve two roles:
1. They are (usually) concise specification/contract for the implementation to follow, and for the client to use.
2. They permit substitution.
These are, from my experience, the principle and most useful reasons to make use of "redundant" interface definitions. What's worse is when people want alternative implementations but only have a concrete instance, they subclass it and break all kinds of contracts making their square peg fit a round hole.
This is less useful when you have ducktyping and consequently every lookalike is considered substitutable for each other.