Grokking SOLID Design Principles
Vote

0% completed

Techniques to Identify ISP Violations

A class should only depend on the methods it actually uses. When a class is forced to implement methods it does not need, the Interface Segregation Principle is being violated.

The hard part is noticing. Below are five signals that an interface has grown too large. Each one is something you can look for during a code review.

1. Low Cohesion in the Interface

Low cohesion means the methods grouped into one interface are not closely related. An interface that mixes unrelated groups of methods will always force some implementer to take on methods it does not want.

Here, `MediaDevice

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%