Command Pattern Considerations

I am in the process of implementing a command pattern to abstract ejb access between client and server. In the command pattern I am implementing, I am using a Command object that gets passed through the Proxy/Business Delegate to the Facade, and to the correct ejb. I have written a BusinessObjectController Bean which I use as a base class for all of my ejb's in hopes that I can use 1 home and remote interface for all of them. I have 1 public method called executeCommand(Command) across all my beans. Everything else is private. They have in a sense become their own command controllers, and decipher the command internally to call private methods.

Like I said, this is an initial concept and implementation is coming shortly. Does anyone see any major problems with using the command pattern this way? If so, could you please give me some pointers?

Thanks

Nic

[900 byte] By [holbrng] at [2007-9-26 7:07:04]
# 1

> I am in the process of implementing a command pattern

> to abstract ejb access between client and server. In

> the command pattern I am implementing, I am using a

> Command object that gets passed through the

> Proxy/Business Delegate to the Facade, and to the

> correct ejb. I have written a BusinessObjectController

> Bean which I use as a base class for all of my ejb's

> in hopes that I can use 1 home and remote interface

> for all of them. I have 1 public method called

> executeCommand(Command) across all my beans.

> Everything else is private. They have in a sense

> become their own command controllers, and decipher

> the command internally to call private methods.

what you have descibed is not the 'command pattern', in the command pattern the command is executed polymorphically. i.e.

aCommand.execute( parameters ) ;

What you have described, somthing accepting the command seems more like the mediator pattern. i.e.

something.executeCommand( Command ) ;

> Like I said, this is an initial concept and

> implementation is coming shortly. Does anyone see any

> major problems with using the command pattern this

> way?

Nit-picking aside what you propose is a good idea No it would seem to be a good idea

> If so, could you please give me some pointers?

>

> Thanks

>

> Nic

MartinS. at 2007-7-1 16:47:31 > top of Java-index,Other Topics,Patterns & OO Design...