Example of Command pattern in context of a non-AJAX website

LahInfofnop

New Member
I have seen numerous examples of the Command patternBut they all tend to be in the context of a desk-top application.i.e "Command decouples the object that invokes the operation from the one that knows how to perform it"In the context of a pure HTML (but Zend Framework MVC driven) website, I am thinking of a user 'clicking a link' which should refresh the current page and invoke a certain command. No matter which page of the site the user is on.An example would be, in a blogging app:i.e To be able to present an HTML form button/s to, say, "Delete Blog Post" on both:
  • 'List Page' (lists blog posts)
  • 'Edit Page' (edits a blog post)
  • The form action on the 'List Page' points to 'List Page'
  • The form action on the 'Edit Page' points to 'Edit Page'
I suspect the Controller part of the ZF MVC is kind-of a command pattern. However, that routes URLs to a particular controller. I am trying to ALSO route command actions to particular command receivers at the same time.Does the command pattern apply here or is it only really useful in the context of rich graphical user interfaces - such as desk-top apps or AJAX-enabled sites?
 
Back
Top