Skip to content

Commit f7de13f

Browse files
addition to readme to contain the Interface Segregation principle
1 parent 9eb52fb commit f7de13f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ The list was inspired by [The Principles of Good Programming](http://www.artima.
3030
* [Single Responsibility Principle](#single-responsibility-principle)
3131
* [Hide Implementation Details](#hide-implementation-details)
3232
* [Curly's Law](#curlys-law)
33+
* [Interface Segregation](#interface-segregation)
34+
3335

3436
## KISS
3537

@@ -315,3 +317,13 @@ Curly's Law is about choosing a single, clearly defined goal for any particular
315317

316318
* [Curly's Law: Do One Thing](http://blog.codinghorror.com/curlys-law-do-one-thing/)
317319
* [The Rule of One or Curly’s Law](http://fortyplustwo.com/2008/09/06/the-rule-of-one-or-curlys-law/)
320+
321+
## Interface Segregation
322+
323+
Reduce fat interfaces into many client specific interfaces. An interfaces should be more dependent on the code that calls it than the code that implements it.
324+
325+
Why
326+
* If a class implements methods that are not needed the caller needs to know about the method implementation of that class. For example if a class implements a method but simply throws then the caller will need to know that this method shouldnt actually be called
327+
328+
How
329+
* Avoid fat interfaces. Classes should never have to implement methods that violate the [Single responsibility principle](#single-responsibility-principle)

0 commit comments

Comments
 (0)