solid-php-example icon indicating copy to clipboard operation
solid-php-example copied to clipboard

The example you show does not conform to Interface Segregation Principle

Open fakharak opened this issue 4 years ago • 0 comments

Although, you are segregating (breaking / granularizing) a larger Interface into smaller interfaces, however only granularizing a large interface into smaller interfaces does not serve the purpose of Interface Segregation Principle in S.O.L.I.D.

In object-oiented programming, the actual purpose of exposing the subsets of the functions of a (serving) implementation class to the client-code, through multiple (segregated) interfaces is to enable the client-side code to access only interface-specific (contextual / subset) functionality of the (serving) implementation class.

See P-15 and P-13 on the link below to understand the purpose of Interface Segregation Principle. That is a powerful feature for Extensibility: Interface Segregation Principle.

https://www.codeproject.com/Articles/18743/Interfaces-in-C-For-Beginners

fakharak avatar Feb 06 '21 22:02 fakharak