Skip to Content
Architectural Patterns
book

Architectural Patterns

by Anupama Murali, Pethuru Raj, Harihara Subramanian J, Pethuru Raj Chelliah
December 2017
Intermediate to advanced
468 pages
13h 12m
English
Packt Publishing
Content preview from Architectural Patterns

Interface segregation principle (ISP) – SOLID

Imagine that you are implementing an interface of a class pets, and the compiler complains about the non-inclusion of bark method in your Cat class; strange, isn't it?

ISP suggests any interface of a class should not force the clients to include any unrequired methods by that client; in our example, Cat does not need to implement bark method, and it is exclusive to Dog class:

The preceding diagram depicts ISP violation and how to get rid of the same by splitting the <<IPets>> interface to represent the Cat and Dog interface explicitly.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Software Architecture Patterns

Software Architecture Patterns

Mark Richards
Design It!

Design It!

Michael Keeling

Publisher Resources

ISBN: 9781787287495Other