Terminology and techniques for implementing commands as objects w/in an application?
I'd like to learn how developers work with commands in applications. In particular, what's the terminology and techniques used for defining and manipulating application commands as objects, for easier scripting, macros, undo, etc. I'm imagining it's done with classes that encapsulate a command's behaviors so helper classes can work with them more easily.
In particular my needs are pretty basic, but I'd like to set things up nicely for future expansion. I'm reworking a command-line image analysis tool, and would like a method to define and recognize the 开发者_如何学Govarious arguments that act as commands, or what I'm calling "operations", that need to call worker functions in the rest of the program. I'd like to define them in one place, and then have my command line parsing routine be able to execute all the commands in a loop. Presumably each command would define its own worker code in an overloaded class.
Sorry for the vaguries, I can't even think of what this is called!
Cheers, Michael
i am used to those being called 'Actions'
精彩评论