Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
OOP

Interface Segregation Principle

Keep interfaces small and focused so classes are not forced to implement unused methods.

Interface Segregation Principle — a practical guide to ISP SOLID with clear examples you can reuse in real projects.

OOP Tutorial Series (50/65). Prefer one article? Read the complete OOP tutorial.

Short description

Many specific interfaces are better than one fat interface.

ISP example

interface CanPrint { public function print(): void; }
interface CanScan { public function scan(): void; }
class SimplePrinter implements CanPrint {
    public function print(): void {}
}

Leave a reply

Your email address will not be published. Required fields are marked *