Sagarnath S
Mar 30, 2023

LSP: The subtype must honor the contracts it promises.

ISP: The caller shouldn't depend on more of the base type's interface than it needs.

Where they fit: If you apply the ISP, you use only a slice of the receiver's full interface. But according to LSP, the receiver must still honor that slice.

If you fail to apply ISP, there can be a temptation to violate LSP. Because "this method doesn't matter, it won't actually be called."

Sagarnath S
Sagarnath S

Written by Sagarnath S

Software Development Engineer - I @CareStack || Web Developer || Angular || ASP.Net Core || C# || TypeScript || HTML || CSS

No responses yet