Skip to content
Commitwise
Menu

Interface segregation principle

Also called: ISP

The I in SOLID: prefer small interfaces shaped by what each client needs over one large interface.

Definition

When an interface bundles many abilities, classes that can only provide some of them have to stub or throw in the rest, and clients that use one method still depend on all of them. Splitting it into role interfaces, which one class may implement several of, keeps every promise keepable.

In practice

DocumentStorage becomes DocumentReader and DocumentWriter, so a read-only backup implements only the reader.

Learn it in context

Lessons that use this term.

Related terms

Esc

Type to search the whole site.