Last active
May 20, 2019 05:08
-
-
Save hackjutsu/e31680294a1380d030686881e19f6b4e to your computer and use it in GitHub Desktop.
[medium snippets] #medium #designPattern #CommandPattern
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
public class CommandA implements Command { | |
public CommandA(ReceiverA receiverA) { | |
this.receiverA = receiverA; | |
} | |
@Override | |
public void execute() { | |
receiverA.doAction(); | |
} | |
@Override | |
public void undo() { | |
receiverA.undoAction(); | |
} | |
private ReceiverA receiverA; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment