Skip to content

Commit 9ed7e28

Browse files
committed
Add encapsulate what changes principle
1 parent 9eb52fb commit 9ed7e28

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ 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+
* [Encapsulate What Changes](#encapsulate-what-changes)
3334

3435
## KISS
3536

@@ -315,3 +316,22 @@ Curly's Law is about choosing a single, clearly defined goal for any particular
315316

316317
* [Curly's Law: Do One Thing](http://blog.codinghorror.com/curlys-law-do-one-thing/)
317318
* [The Rule of One or Curly’s Law](http://fortyplustwo.com/2008/09/06/the-rule-of-one-or-curlys-law/)
319+
320+
## Encapsulate What Changes
321+
322+
A good design identifies the hotspots that are most likely to change and encapsulates them behind an API. When an anticipated change then occurs, the modifications are kept local.
323+
324+
Why
325+
326+
* To minimize required modifications when a change occurs
327+
328+
How
329+
330+
* Encapsulate the concept that varies behind an API
331+
* Possibly separate the varying concept into its own module
332+
333+
Resources
334+
335+
* [Encapsulate the Concept that Varies](http://principles-wiki.net/principles:encapsulate_the_concept_that_varies)
336+
* [Encapsulate What Varies](http://blogs.msdn.com/b/steverowe/archive/2007/12/26/encapsulate-what-varies.aspx)
337+
* [Information Hiding](https://en.wikipedia.org/wiki/Information_hiding)

0 commit comments

Comments
 (0)