intermediateInterface Segregation Principle

How is the Interface Segregation Principle different from the Single Responsibility Principle?

SRP is about a class having exactly one reason to change — it's a rule about how a class's own responsibilities should be scoped. ISP is about an interface not forcing the classes that implement it to depend on methods they don't actually use — it's a rule about how a contract's shape affects every implementer of that contract. A class can perfectly satisfy SRP while still being harmed by an ISP violation: a SimplePrinter class with the single, focused job of printing can still be forced to implement scan() and copy() methods it has no use for, if the Machine interface it implements bundles unrelated capabilities together. In short, SRP is scoped to a class's own job, while ISP is scoped to how well an interface's shape matches what each of its implementers can genuinely support.

Ready to master this question?

Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.

Sign in to generate a response

Next Step

Continue to Why does depending on concrete classes instead of interfaces make unit testing harder?← Back to all Low-Level Design & Design Patterns questions