> I have a BusinessDelegate for each as well with a method for each method on the CFC.
On second thought that sounds better than what I suggested. :-) Douglas Steve House wrote: > > I do have a service for each CFC. > I have a BusinessDelegate for each as well with a method for each > method on the CFC. > > Ex: > public class EmployeeDelegate > { > public function EmployeeDelegate( responder : Responder ) > { > this.service = > ServiceLocator.getInstance().getRemoteObject("employeeService"); > this.responder = responder; > } > > > public function readEmployeeByUsername(sUsername:String) : void > { > var call : Object = service.readEmployeeByUsername(sUsername); > call.resultHandler = responder.onResult; > call.faultHandler = responder.onFault; > } > private var responder : Responder; > private var service : Object; > } > > > On 12/6/06, *Douglas McCarroll* < > [EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > > If I understand correctly (newbie speaking) you'd have: > > - A service specified on ServiceLocator for each of your CFCs > > - A BusinessDelegate for each method that you'll be calling > > Steve House wrote: > > > > Hank, > > > > Thanks for your reply. I am not sure I am explaining this correctly > > but let me try adding these details and see if this helps. My > backend > > is ColdFusion and I have created Flex remote objects to several CFCs > > that each correspond to a separate business object (not necessarily > > one table). For example, I have an employeeGateway.cfc who's methods > > all pertain to employees (e.g. readEmployeeById(), > > readEmployeeByUsername(), addEmployeePermission()). From what I > > understand I have to set up a remote object connection to each CFC > > that I want to talk to. Although I could create a single CFC to > group > > together lookup table queries I prefer to keep them in their > distinct > > CFCs to allow for future methods related to those objects. > > > > Does this clear things up at all or am I still way off? Thanks again > > for your help! > > > > Steve > > > > On 12/5/06, *hank williams* < [EMAIL PROTECTED] > <mailto:hank777%40gmail.com> > > <mailto:[EMAIL PROTECTED] <mailto:hank777%40gmail.com>>> wrote: > > > > Steve, > > > > You definitely shoud not have a business delegate for every lookup > > table. I dont really understand the detail of what you explained in > > your email, but communications between a client and a server should > > never be as granular as mapping just directly to a table. Think of > > communications with a server as asking high level questions like, > "who > > are my top spending customers this month". This might require access > > to several tables. This calculation work should be done on the server > > and the results should then be delivered from the server to the > > client. The client should generally not be taking the results of > > several table searches and intersecting, joining, merging or anything > > of the sort. That is really server side work. > > > > Regards, > > Hank > > > > > > > > On 12/5/06, stevehousefl <[EMAIL PROTECTED] > <mailto:cyberdust%40gmail.com> > > > <mailto:cyberdust% <mailto:cyberdust%25> 40gmail.com > <http://40gmail.com>>> wrote: > > > Douglas (and all), > > > > > > Since they are not dependent on each other, I went with just > having a > > > single command fire 6 new events. I will look into the MacroCommand > > > though. > > > > > > As far as the 6 different datasources, it is not. Perhaps this is > > > incorrect, but I have a business delegate for each lookup table > and a > > > service (remote object) for each Coldfusion component that I am > > > talking to. > > > > > > For example: > > > > > > My EVENT_LOAD_CONTROL_PANEL executes the > LoadControlPanelDataCommand > > > The LoadControlPanelDataCommand fires the EVENT_READ_ALL_QUEUES > > (and 5 > > > other events) > > > The EVENT_READ_ALL_QUEUES executes the ReadAllQueuesCommand > > > The ReadAllQueuesCommand creates a QueueDelegate and executes > > > QueueDelegate.readAllQueues() > > > The QueueDelegate creates an instance of the ServiceLocator and > > > executes .getRemoteObject("queueService") > > > The queueService is configures in Services.mxml as > > > > > > <mx:RemoteObject > > > id="queueService" > > > destination="ColdFusion" > > > source="CF.queueHandler" > > > showBusyCursor="true" > > > result="event.token.resultHandler( event );" > > > fault="event.token.faultHandler( event );"/> > > > > > > Does this make sense???? > > > > > > Thanks, > > > > > > Steve > > > > > > > > > --- In flexcoders@yahoogroups.com > <mailto:flexcoders%40yahoogroups.com> > > <mailto:flexcoders% <mailto:flexcoders%25>40yahoogroups.com > <http://40yahoogroups.com>>, Douglas McCarroll > > > <[EMAIL PROTECTED]> wrote: > > > > > > > > Hi Steve, > > > > > > > > I'm going to take a stab at this as I've been studying the > Command > > > > pattern (as defined in GoF) and Cairngorm lately. In fact I'll be > > > > presenting on the subject here in Boston tomorrow evening, so > > this is > > > > right up my alley. (www.bfpug.us <http://www.bfpug.us> < > http://www.bfpug.us <http://www.bfpug.us>>) :-) > > > > > > > > > > how do you handle 6 different results since there is only 1 > > > > > onResult function. > > > > > > > > I think that the answer here is "you don't". :-) > > > > > > > > Cairngorm has a SequenceCommand which has: > > > > > > > > public var nextEvent : CairngormEvent; > > > > > > > > You can then call its executeNextCommand() from your result() > > method > > > > which launches that event. > > > > > > > > This will work well enough if you need results from command_1 > > before > > > you > > > > make the service call in command_2, which you need before > > command_3, > > > etc. > > > > > > > > On the other hand, if that's not the case, what to do? > > > > > > > > The Gang Of Four chapter on the Command pattern describes a > > > MacroCommand > > > > that executes a number of (Simple)Commands. As described it > > seems to > > > > simply fire them off, one after another. Wouldn't be hard to > > roll your > > > > own, extending ICommand, with an array property, and passing in > > Command > > > > objects. > > > > > > > > I could even see creating an MacroEvent class that kept track of > > > whether > > > > its Commands had finished and that then did something when > all were > > > > finished. > > > > > > > > Other Cairngorm programmers, wiser than I, will probably ask > > you wise > > > > questions about why you wish to pull data from six different data > > > > sources... :-) > > > > > > > > > > > > Douglas > > > > > > > > > > > > ------------------------------------------------- > > > > > > > > Douglas McCarroll > > > > > > > > CairngormDocs.org Webmaster > > > > http://www.CairngormDocs.org <http://www.CairngormDocs.org> > < http://www.CairngormDocs.org <http://www.CairngormDocs.org>> > > > > > > > > Flex Developer > > > > http://www.brightworks.com <http://www.brightworks.com> < > http://www.brightworks.com <http://www.brightworks.com>> > > > > 617.459.3840 > > > > > > > > ------------------------------------------------- > > > > > > > > > > > > > > > > > > > > > > > > > > > > stevehousefl wrote: > > > > > > > > > > I have a command that I would like to have pull lookup data > > from 6 > > > > > different BusinessDelegates. Should that one command call all 6 > > > > > delegates or should it fire 6 new events that call 6 new > > commands? > > > > > > > > > > If the one command should call all 6 delegates in its execute > > > > > function, how do you handle 6 different results since there > > is only 1 > > > > > onResult function. > > > > > > > > > > I am using Cairngorm 2.1. > > > > > > > > > > Thanks in advance, > > > > > > > > > > Steve > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > Flexcoders Mailing List > > > FAQ: > > http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > <http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt> > > <http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > <http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt>> > > > Search Archives: > > http://www.mail-archive.com/flexcoders%40yahoogroups.com > <http://www.mail-archive.com/flexcoders%40yahoogroups.com> > > <http://www.mail-archive.com/flexcoders%40yahoogroups.com > <http://www.mail-archive.com/flexcoders%40yahoogroups.com>> > > > Yahoo! Groups Links > > > > > > > > > > > > > > > > > > > > >