Before you start
ISP is the SOLID principle that most directly punishes fat interfaces. It's also the one you'll invoke most often in real code review: "this interface is too big; split it."
The one-line version
Use many small focused interfaces instead of one big one.
Why fat interfaces hurt
Every method on an interface is a promise. A child class that says "I'm Serializable" is promising to serialize correctly. If half the children implement the method as "raise not implemented", the interface is lying about what its members can do.
Callers react in the worst possible way: they add runtime type checks.
if isinstance(obj, LegacyReport):
... # skip serialization
else:
obj.serialize(...)
Once one caller does this, others copy it. The interface stops being useful because everyone has to know the specific types anyway.
The ISP fix
Split the interface by ability. A LegacyReport doesn't
inherit from Serializable at all — problem gone at
compile time.
Rule of thumb: an interface should be as small as possible while still being useful to its callers.
How the SOLID letters connect
Notice how they stack on each other:
- SRP — a class has one reason to change
- OCP — you can add new behavior without editing old code
- LSP — a child class doesn't surprise the parent's callers
- ISP — a class only relies on the methods it actually uses
- DIP (next lesson) — high-level code depends on abstractions, not specifics
They're not five random rules — they support each other. ISP is the structural fix that prevents most LSP problems. OCP is what you get when you follow the other four consistently. Mature design systems reach for them together.
About the exercise
Printers, scanners, and fax machines are the textbook ISP example because real hardware devices genuinely have different abilities. Every hardware / SaaS / ML system has this shape: a family of things, none of which does the full menu.
If your solution has raise NotImplementedError anywhere,
you haven't finished. Delete the method entirely and stop
inheriting the interface — that's the ISP-native answer.