command-pattern

What is the Action Design Pattern?

What is the Action Design Pattern, I haven't heard of it before? I am suspecting it is the same as the Command Design pattern [wikipedia] but I can't find any resources on it. ...

Command Pattern: Client and Invoker

In the command pattern: Why shouldn't the client participant be the same class as the invoker participant? Is there possible scenarios when the client participant and the invoker participant can be the same class? ...

How do I use the command pattern to reduce the complexity of a menu?

Say I have 4 buttons and I want each one to do a different thing. I don't want a big switch statement where I do a different thing based on which button was pushed, nor do I want a separate method for each button click. Is command pattern a good way to solve this? ...

Is an anonymous function a good way to implement the command pattern?

I'm quite new to this pattern... ...

Command Pattern: Executing multiple commands in sequence

I want to issue a series of Command executions, but only when the prior command succeeded. Right now i am raising an event within the command object indicating whether the command succeeded or failed. I am using this to control execution, but it feels inelegant. Example: command1.CommandSucceeded += delegate { command2.Execute(); }; co...

unable to return to main() from a method reading standard input stream

I am basically trying to return from a method which reads user input from the standard input stream. Since the user has the option to quit the application, I am trying to figure out the best way to do this exit. Ideally I will be able to return from begin() and let main() finish, thus quiting the applicaiton. public static void main(Str...

What is the accepted pattern for WPF commanding in MVVM?

I'm working on a WPF app and I understand the command pattern pretty well, but I've found that there are several different implementations of the command pattern for MVVM. There's Josh Smith's implementation in his WPF sample app, the DelegateCommand from Prism, and the CommandBindings implementation. My question is, what is the general...

Java + Command Pattern + Spring + remoting : How to inject dependencies to Command object ?

In my current project I'm dealing with EJBs implementing huge interfaces. Implementation is done through a business delegate, which implement the same interface and contains the real business code. As suggested by some articles like http://code.google.com/intl/fr/events/io/2009/sessions/GoogleWebToolkitBestPractices.html http://www....

Command Pattern & parameter design

My understanding of the Command Pattern is that you simply have 1 virtual method 'execute()', and all dependencies that an implementation might have are put in the constructor or through setter injection in the implementation (like discussed here). However, in the WPF implementation of the pattern, I noticed they are passing a generic a...

Implementing the command pattern

I am in the design process of an application, and I would like to use the command pattern for undo/redo purposes. I did some research into the command pattern but the only thing I don't get is: Should a command have the undo and redo methods, or should I make two separate commands, one for undo and one for redo, and call those from the m...

In the Command pattern what do you call a command that groups together other commands?

This should be easy, I am trying to come up with the name for a command class that is a collection of other commands. All the sub commands will be run, when the master command is run. Any ideals? ...

How do I have a Silverlight databinding update the model as the user types?

I'm currently using Silverlight 4 and following the MVVM pattern. I have login boxes bound to my ViewModel like so: <PasswordBox Password="{Binding Path=Password, Mode=TwoWay}" /> I then later on have a button bound to a Command which listens to the ViewModel's PropertyChanged event and when one of the databindings has its data update...

Why doesn't GWT use gwt-dispatch?

After looking into gwt-dispatch and the Google Wave I/O presentation (Best practices) (video here), I'm wondering why the official GWT release (2.0) doesn't use dispatch (ie. the command pattern) for it's RPC calls. Does anyone know? ...

MvcContrib.CommandProcessor.RulesEngine tutorial(s)

Hi! I am studying the CodeCampServer. I am confused about the ASP.NET MvcContrib.CommandProcessor.RulesEngine. Are there any tutorials about the RulesEngine of the MvcContrib? Or can anybody of you explain me how does this work and what benefits I gain? ...

Where to keep gwt-dispatch classes?

Where gwt-dispatcher classes (Action, Result, Handler) should be kept? I mean it should be all in client package or maybe shared or any other combination? How do You handle this? ...

Asynchronous request management application design

I have a daemon which exposes RMI interface for submission of various potentially long running bulk operations. The daemon may also talk to workflow/BPM system as a part of request processing. This essentially means that the request processing (post submission) also has an asynchronous component to deal with; which probably would require...

MVC and command pattern

Hello there Ok, this is kinda dumb. I'm trying to wrap my head around the use of the MVC and Command Patterns. The questions basically concern where to place code. In the MVC pattern, where are the Commands instantiated? Are they created by the Controller, or are they contained fully in the Model or neither. BTW, Should one be using...

Persistent Command pattern

Hi all, what I am trying to achieve is to have a persistent list of "undoable" changes on a persistent storage (database). The architecture employs repositories for the domain objects and Unit of Work for transactions and for the final part (undo) I thought of using the command pattern. However, for me there seems no good solution how ...

How to disable Context menu in wpf?

I have two Menu items in a wpf context, I bind them with command, how do I hide context menu when both items are not available, I mean when both commands cannot be executed? ...

Are "volatile" data bindings in Windows Forms possible?

Let's assume I'm implementing a Winforms UI where all commands adhere to the following pattern: interface ICommand { bool CanExecute { get; } void Execute(); } Buttons or menu items that trigger such a command should have the following set-up: property Enabled is bound to the command's CanExecute event Click is linked to the...