Created
April 14, 2019 12:59
-
-
Save Sean-Bradley/ffe5d07b4a84811668f7b3e45c634dab to your computer and use it in GitHub Desktop.
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
def __init__(self): | |
# initialize the successor chain | |
self.chain1 = Dispenser50() | |
self.chain2 = Dispenser20() | |
self.chain3 = Dispenser10() | |
# set the chain of responsibility | |
# The Client may compose chains once or | |
# the hadler can set them dynamically at | |
# handle time | |
self.chain1.set_successor(self.chain2) | |
self.chain2.set_successor(self.chain3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment