[jboss-dev-forums] [Design of JBoss jBPM] - Re: Commands: Maybe result should be part of the Command-Obj

tom.baeyens@jboss.com do-not-reply at jboss.com
Tue Apr 17 04:08:32 EDT 2007


"camunda" wrote : I have written a EJB3-CommandServiceBean which has some additional informations about the processes and some Entities in the process variables. So it can load the required Entity-Objects (via JDO in that project). That could be handled in the CommandServiceBean, no problem, no overhead with multiple remote calls (jepp, we are in a Swing Client).
  | 
  | But how to return these additonal values? 
  | 
I didn't yet follow the scenario that you describe.  Also, I didn't find in your scenario hints at why a plain Object is no good.  IMO, if you return an Object in the interface, the command itself can decide to return a Map, the command itself or any other object.  

I'm not saying that this the best approach.  I'm giving you my reasoning so that you can explain where you see different.  This also holds for the rest of this post (probably all of my posts:-)
"camunda" wrote : 
  | 
  | change the result of the execute-method is not a good idea, because then, we have to now in the code which implementation of the CommandService we use, bad idea.
  | 
  | 
i think it is the Command that should determine the return value and document that in the javadocs.  the command service implementation should not do anything with the return value.

it might be that some commands are not usable in certain command service implementations.  E.g. when you implement a remote command service and the return value of the command is not serializable...

but in any case, it is the command alone that should determine the result, unrelated to the command service implementation
"camunda" wrote : 
  | 
  | add the values to the process variables? sounds good at first, but has the problem, if I add them to the processInstance (for example) before returning, they are treated as process variables and persistet (which I do not want).
  | 
  | 

i don't get this.  you only need to explain if it is still relevant.

"camunda" wrote : 
  | 
  | So if we have a Map as a return value, every CommandService-Implementation could add, what it wants to add. And the client can look for entries in the Map and use them, if he finds something. A concept like the "hints" for the PersistenceProvider in EJB 3...
  | 
  | What do you think?
  | 
  | 

That could still be done with an object.

if (returnValue instanceof Map) ...

or 

if (returnValue instanceof Hints) ...


"camunda" wrote : 
  | 
  | I know, the most of the problems are not problems in the Webapp-World, but I think it is worse to support Remote-Apps too...
  | 
  | 

I want the command pattern to support both as good as possible.   Let's keep this good discussion going.

"camunda" wrote : 
  | 
  | Thanks for any hints, ideas and comments! Unfortunatly, I am a little bit under time pressure for that issue :-(
  | 
  | Regards
  | Bernd

feel free to contact me on skype.  or send me your telephone number and we can have a discussion. i'm available for most of today and tomorrow.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4037869#4037869

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4037869



More information about the jboss-dev-forums mailing list