Last active
January 3, 2016 03:39
-
-
Save binford2k/8403860 to your computer and use it in GitHub Desktop.
Demonstrate composition instead of inheritance
This file contains hidden or 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
################### don't do this ################### | |
node default { | |
include something | |
include something else | |
} | |
node 'boo' inherits default { | |
include a third thing | |
} | |
################ instead, do this ################### | |
class base { | |
include something | |
include something else | |
} | |
node default { | |
include base | |
} | |
node 'boo' { | |
include base | |
include a third thing | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment