stuka
08-20-2002, 01:16 PM
Okay - didn't have time to do this up last night (we had an AC emergency at home). However, quoting from Design Patterns:Use the Command pattern when you want to
-parameterize objects by an action to perform, as MenuItem objects did above. You can express such paramaterization in a procedural language with a callback function, that is, a function that's registered somewhere to be called at a later point. Commands are an object-oriented replacement for callbacks.
And no, I didn't add the highlighting!
OK, just for fun, here's some linkage for further details, as I'm not about to type all of this:
http://www.cs.brown.edu/courses/cs032/lectures/command.pdf
http://exciton.cs.oberlin.edu/javaresources/DesignPatterns/command.htm
Oh, and a bit relating the command pattern to distributed programming:
http://www.wgrosso.com/Articles/Writings/TheCommandPatterninDistri.html
Hope this helps make my point!
-parameterize objects by an action to perform, as MenuItem objects did above. You can express such paramaterization in a procedural language with a callback function, that is, a function that's registered somewhere to be called at a later point. Commands are an object-oriented replacement for callbacks.
And no, I didn't add the highlighting!
OK, just for fun, here's some linkage for further details, as I'm not about to type all of this:
http://www.cs.brown.edu/courses/cs032/lectures/command.pdf
http://exciton.cs.oberlin.edu/javaresources/DesignPatterns/command.htm
Oh, and a bit relating the command pattern to distributed programming:
http://www.wgrosso.com/Articles/Writings/TheCommandPatterninDistri.html
Hope this helps make my point!