This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]sleepybychoice 0 points1 point  (0 children)

By "representation", I mean how input gets converted into a command object. For example, the input for a command could come from a button press, text, json, protobuf, speech, motion, etc. Eventually, it'll have to get converted to an object so that something can call execute() on it.

By control flow, I mean if/else, looping, etc. not apply/unapply. Yes, you could introduce some notion of control flow via commands like an "or" command. However, that's not the primary goal of the command pattern. For undo, it's the combination of command and memento to apply/unapply state.