Skip to content

Commit

Permalink
chapter 04: example of a serviceContainer that implements a interface…
Browse files Browse the repository at this point in the history
… that violates the interface segregation principle
  • Loading branch information
devcorpio committed Mar 31, 2019
1 parent af597fa commit 4ce1081
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions chapter-04-the-interface-segregation-principle/serviceContainer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* In order to improve the understanding of this code, this file it is supposing to implement the following interface:
*
* interface ServiceContainerInterface {
* function get(name);
* function set(name, fn);
* }
*
* Quack Quack Quack 🦆 typing :D
*/

function serviceContainer() {
function get(name) {
// something here...
}

function set(name, fn) {
// something here
}

return {
get,
set,
};
}

module.exports = serviceContainer;

0 comments on commit 4ce1081

Please sign in to comment.