2.2.7 · D5Design Principles

Question bank — SOLID — Interface Segregation Principle

2,224 words10 min readBack to topic

Before we begin, the words we lean on repeatedly:

  • ISP — Interface Segregation Principle: no client should be forced to depend on methods it does not use.
  • Client — any code that depends on an interface. This includes the caller AND the implementer. Both are dragged into whatever the interface declares.
  • Role interface — a small interface defined by what one kind of client needs, grouping only methods that are used together.
  • Fat interface — one interface bundling capabilities that different clients use separately.

The forced-dependency metric (symbols defined once, used throughout)

Several traps below refer to a small counting formula. We define it carefully here so no symbol appears unexplained.


True or false — justify


Spot the error


Why questions


Edge cases


Connections