Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Command Pattern and Concurrent design

 
Gerald Davis
Ranch Hand
Posts: 872
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because of the limits imposed on developing faster computers, the only way forwards is going to be multi-processor computer. To take advantage of those systems we need to design our application to take advantage of this different architecture. Concurrent design is the future much the same way that Object Oriented technology has today.

I want to know if the Command Pattern makes concurrent design simpler to implement. I don�t understand the implication of using Command Pattern in a concurrent application.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, the implications will depend on how you implement the Command pattern, not the pattern itself.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Command is nicely suited to parallel processing. If I want to ask another thread (potentially on another processor or JVM) to do a task I encapsulate the task in a Command and pass it along. I can pass new commands to another process without warning because it will execute anything with the proper interface.

For cluster management I execute Commands and gather information from six servers in a cluster by passing the command name, not the command itself. That's not quite as kool becuase I have to deploy the commands to the servers.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic