Skip to content
Veltoryx Technologies
ProLesson 3.4Intermediate7 min readUpdated 31 October 2026

Interface Segregation Principle

Learn why small interfaces built around what clients need beat one big interface, using a printer example, and how to avoid classes that are forced to implement methods they cannot honour.

Imagine a job contract that lists the duties of every role in a company: operate the crane, cook lunch, teach maths, repair cars and write software. Now imagine that every employee, including the receptionist, must sign this one contract. The receptionist is forced to promise things she can never do. And if the company adds a new duty, say "drive the delivery van", every single employee must sign again.

That is the situation a fat interface creates in code. The fourth SOLID principle is the cure:

Clients should not be forced to depend on methods they do not use. Prefer several small, specific interfaces over one large, general one.

The word "segregation" means "separating". We separate a large interface into smaller ones, each built around one role that a client needs.

01A problem you can see: the all-in-one device

An office has devices that can print, scan and send faxes. A designer starts with one interface for all of them:

Before: one fat interface
public interface MultiFunctionDevice {
    void print(Document document);
    void scan(Document document);
    void fax(Document document);
}

An all-in-one machine can do all three, so it implements everything without trouble. But the office also has a cheap printer that only prints:

A simple printer is forced to carry methods it cannot honour
public class BasicPrinter implements MultiFunctionDevice {

    public void print(Document document) {
        /* print the pages */
    }

    public void scan(Document document) {
        throw new UnsupportedOperationException("This printer has no scanner");
    }

    public void fax(Document document) {
        throw new UnsupportedOperationException("This printer has no fax");
    }
}

The interface forces BasicPrinter to say "I can scan and fax" when it cannot. The compiler is happy, but the program has a trap: any code that receives a MultiFunctionDevice believes it can call scan, and one day it will, and the program will crash at run time.

A fat interface forces a simple printer to implement scan and fax; three small interfaces let each class promise only what it can do
Fig. 1 · A fat interface forces a simple printer to implement scan and fax; three small interfaces let each class promise only what it can do

Loading the rest of the lesson…