Created
March 2, 2016 19:01
-
-
Save uri-chandler/167ce96017e661373a71 to your computer and use it in GitHub Desktop.
[Loose Coupling Is A Lie] Code Listing 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Example of loose coupling between work() and shovel.use() | |
*/ | |
function work(tool){ | |
tool.use(); | |
} | |
var shovel = { | |
use: function(){ console.log("Every day I'm shoveling...umph umph") } | |
}; | |
work(shovel); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment