Interface Segregation Principle
The Interface Segregation Principle dictates that client code should not be forced to depend
on methods it does not use
¹⁶
. The principle intends to fix the problem of “fat” interfaces which
define many method signatures. It relates slightly to the Single Responsibility Principle in that
interfaces should only have a single responsibility. If not, they’re going to have excess method
baggage that client code must also couple with.
Consider for a moment the following interface:
Do'stlaringiz bilan baham: |