Skip to content

add redo function into command pattern#46

Merged
iluwatar merged 3 commits into
iluwatar:masterfrom
zhwbqd:master
Apr 17, 2015
Merged

add redo function into command pattern#46
iluwatar merged 3 commits into
iluwatar:masterfrom
zhwbqd:master

Conversation

@zhwbqd

@zhwbqd zhwbqd commented Apr 15, 2015

Copy link
Copy Markdown
  1. add redo function into command pattern.
  2. add .iml and .idea into .gitignore

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just thinking...
can we make undo()/redo() (as well as execute()) return boolean instead of void, so we can't shrink if no target provided, target already shrinked (small) or target is immune.
as result command can't be queued/dequeued if execute() fails.

@iluwatar

Copy link
Copy Markdown
Owner

This looks good to me. The queues make the example more realistic.

@iluwatar

Copy link
Copy Markdown
Owner

Returning boolean from undo()/redo()/execute() is ok too, if you want to add that. Let me know when you're done with the changes and I will merge the PR.

@iluwatar iluwatar closed this Apr 17, 2015
@iluwatar iluwatar reopened this Apr 17, 2015
iluwatar added a commit that referenced this pull request Apr 17, 2015
add redo function into command pattern
@iluwatar iluwatar merged commit d66e63a into iluwatar:master Apr 17, 2015
pratigya0 pushed a commit to pratigya0/java-design-patterns that referenced this pull request Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants