Skip to content

Instantly share code, notes, and snippets.

@hackjutsu
Last active May 20, 2019 05:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hackjutsu/e31680294a1380d030686881e19f6b4e to your computer and use it in GitHub Desktop.
Save hackjutsu/e31680294a1380d030686881e19f6b4e to your computer and use it in GitHub Desktop.
[medium snippets] #medium #designPattern #CommandPattern
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