Focused contracts
Design interfaces around one coherent client need, not one organizational concept.
ISP says clients should not be forced to depend on methods they do not use. In practice, it helps you resist giant service interfaces that become dumping grounds for unrelated behavior. The principle is especially valuable in enterprise Java codebases where shared contracts tend to grow by accretion.
As an order platform grows, teams often create broad interfaces such as `OrderService` or `CustomerOperations` that mix reading, writing, workflow coordination, reporting, and notification side effects. ISP helps prevent those interfaces from turning every client into a dependent of behavior it never asked for.
ISP is not about maximizing the number of interfaces. It is about shaping contracts around real usage. A bloated interface leaks unrelated capabilities into many parts of the codebase and makes refactoring more dangerous.
In Java, ISP often improves service design, gateway boundaries, and internal module contracts. It can also help reveal that one implementation class is taking on too many roles.
The practical test is simple: if a caller needs only one small slice of the contract, why is it coupled to everything else?
Design interfaces around one coherent client need, not one organizational concept.
Smaller interfaces make implementations and callers easier to change independently.
Dependency inversion becomes cleaner when the abstractions themselves stay narrow.
package org.javaomnibus.ecommerce.principles;
interface OrderReader {
Order findById(String orderId);
}
interface OrderPlacer {
void place(Order order);
}
final class OrderApplicationService implements OrderReader, OrderPlacer {
@Override
public Order findById(String orderId) {
return new Order(orderId);
}
@Override
public void place(Order order) {
System.out.println("placing " + order.orderId());
}
}
record Order(String orderId) {}
If taken too far, ISP can produce overly fragmented APIs that are harder to discover. The goal is client-focused cohesion, not one-method interfaces everywhere.