Interface Segregation principle
As Martin states, this principle deals with the inconveniences of "fat" interfaces. And the problem arises when the interfaces of the class can be logically fragmented into distinct groups or methods.
In this case, if there is more than a client of our application, chances are that some clients are connected to a functionality they never use.
Back to our demo again: the mere review of the definition reveals that our system has some defects from the point of view of this principle.
First, we're implementing a method that is only used by a type of a SportCar client: the Mercedes. The other brands don't use it. In case a new condition arises for a different brand, new options should be created.
So, this marks a difference ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access