NOTE

Interface Segregation Principle

What the interface segregation principle is, why it is needed, and how to keep interfaces small and tailored to their callers.

Software Architecture & EngineeringCreated Updated 1 min readhistorical

This is a historical learning note and may contain outdated or incomplete understanding.

1. What Is the Interface Segregation Principle?

An interface should do only one thing; interfaces should be concise and focused.

2. Why Is the Interface Segregation Principle Needed?

Improve code readability.

Decoupling.

3. Implementing the Interface Segregation Principle

Keep interfaces as small as possible. One interface should serve only one submodule or piece of business logic.

Customize services for classes that depend on an interface. Provide only the methods the caller needs and hide methods it does not need.

4. References

Discussion

Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub