liveBook · Manning

Interface Segregation Principle

Also called ISP

The Interface Segregation Principle states that clients should not be forced to depend on interface operations they do not use, favoring focused, client-specific interfaces.

How 4 Manning books explain it

Grokking Software Architecture

The Interface Segregation Principle states that a class should not be required to depend on or implement interface methods it does not use.

How it is used
Guides interface design toward small, role-specific contracts that avoid forcing clients to implement unused methods.
How deep it goes
Defines the principle, illustrates before-and-after code, and explains interface bloat and unnecessary coupling.
Examples
Uses soccer practice roles and Midfielder and Goalie classes to contrast bloated and focused interfaces.
What you can do after
Evaluate interfaces by checking whether clients must depend on or implement methods they do not use.

Read how Grokking Software Architecture explains Interface Segregation Principle →

The Art of Unit Testing 3e

The interface segregation principle favors small, client-specific interfaces instead of forcing consumers to depend on broad interfaces.

How it is used
Simplifies dependencies and makes unit tests easier to control through consumer-specific adapter interfaces.
How deep it goes
Explains adapter boundaries, naming, parameters, injection, and fakes, but stops short of broader design theory.
Examples
Uses a network adapter around node-fetch, website verification, functional injection, constructor injection, and mocked adapter tests.
What you can do after
Builds a focused adapter and replaceable fake for isolating consumer behavior in tests.

Read how The Art of Unit Testing 3e explains Interface Segregation Principle →

Spring Start Here, Second Edition

Interface segregation is a design principle that favors several focused interfaces over one interface containing operations that clients do not need.

How it is used
Uses focused repository contracts to let applications select only the persistence operations they need.
How deep it goes
Defines the principle and illustrates it with CRUD, paging, sorting, and technology-specific repository contracts.
Examples
Contrasts CrudRepository with PagingAndSortingRepository, JpaRepository, and MongoRepository.
What you can do after
Apply it via Spring Data by choosing a repository contract that matches the operations an application needs.

Read how Spring Start Here, Second Edition explains Interface Segregation Principle →

Clean Applications with Hexagonal Architecture

The Interface Segregation Principle states that clients should not be forced to depend on interface operations they do not use.

How it is used
Keeps repository contracts focused on the methods their clients actually use.
How deep it goes
Defines read-side and write-side repository conventions, but leaves interface granularity to team judgment.
Examples
Uses ArticleRepository methods for saving, loading aggregates, and retrieving DTOs.
What you can do after
Apply it by splitting a growing repository into consumer-focused interfaces while retaining one adapter implementation.

Read how Clean Applications with Hexagonal Architecture explains Interface Segregation Principle →

Also covered in

What to know first

Related concepts

Questions about Interface Segregation Principle

What is Interface Segregation Principle?

The Interface Segregation Principle states that clients should not be forced to depend on interface operations they do not use, favoring focused, client-specific interfaces.

Which Manning books explain Interface Segregation Principle?

Grokking Software Architecture, The Art of Unit Testing 3e, Spring Start Here, Second Edition and Clean Applications with Hexagonal Architecture.

What should I know before learning Interface Segregation Principle?

Manning books that teach Interface Segregation Principle usually introduce interface, object-oriented programming, abstraction and coupling first.

What is Interface Segregation Principle a kind of?

Interface Segregation Principle is a kind of SOLID principles. The SOLID principles are five object-oriented software design guidelines concerning responsibility, extensibility, substitutability, interface design, and dependency direction.

What is Interface Segregation Principle also called?

Interface Segregation Principle is also called ISP.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.