Skip to content

Commit

Permalink
violate interface segregation
Browse files Browse the repository at this point in the history
  • Loading branch information
kenziehong committed Jan 14, 2021
1 parent 60a0e0b commit 6f72952
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions Basic/Solid/ShapeInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

interface ShapeInterface {
public function area();
public function volume();
}
6 changes: 5 additions & 1 deletion Basic/Solid/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ Let q(x) be a property provable about objects of x of type T. Then q(y) should b
q(x) x of type T
q(y) y of type S (subtype of T)

This means that every subclass or derived class should be substitutable for their base or parent class.
This means that every subclass or derived class should be substitutable for their base or parent class.

# Interface Segregation Principle
A client should never be forced to implement an interface that it doesn’t use, or clients shouldn’t be forced to depend on methods they do not use.

0 comments on commit 6f72952

Please sign in to comment.