Repost - link problem

Hey giffman,

The Sequence command should work for you in this case.  Execute the
executeNextCommand(); statement in the onResult functions of your
commands.  I guess using the next command encapsulates the Command class
by avoiding the direct dispatch of events.  Pretty much the same
difference though.  To increase performance of your app, you could come
up with a way to make only one call to the server for all of your data
needs.  Have the server create the dataset (with a unique id), populate
it and send back the entire object.  Here is a simple SequenceCommand
example.  For Cairngorm 2.1, you would have to use ICommand and add
IResponder.  Execute the next statements in the onResult functions, so
that they don't execute until the data is returned.

View Sample
<http://www.cflex.net/showFileDetails.cfm?ObjectID=422&Object=File&Chann\
elID=1>

-TH

--- In flexcoders@yahoogroups.com, "Ralf Bokelberg" <[EMAIL PROTECTED]>
wrote:
>
> Some time back there was a version of the frontcontroller, which
registered
> command instances instead of the command class. I guess the current
sequence
> command is leftover from this version.
> Cheers,
> Ralf.
>
>
> On 12/19/06, thegiffman [EMAIL PROTECTED] wrote:
> >
> > I'm building a live charting application which uses the Cairngorm
> > design pattern. I'm running into a bit of an issue which I thought a
> > SequenceCommand might be just the ticket. However, further
> > investigation has lead me to question not just the use of
> > SequenceCommands in this case, but their usefulness in general.
> >
> > For me to create a new data set for the chart (which actually
involves
> > two charts - one zoomed out fully and one zoomed in on an area), I
> > need to do several commands in sequence:
> >
> > 1 - create a data set with a unique id from the back end.
> > 2 - query the back end for the coarse grain data.
> > 3 - query the back end for the fine grain data.
> > 4 - add the data set to the document model.
> >
> > Basically these are four different commands that should be executed
in
> > sequence. And it makes sense from an architectural standpoint for
> > them to be separate - I can see wanting to query for fine data in
> > other situations than data set creation (like an update).
> >
> > But here's the kicker - sequence commands don't really seem set up
to
> > do this. I can't really get at the commands themselves to set the
> > next event with the constructor, since the front controller handles
> > all this. As such, the sequence command can really just do one
action
> > - querying the back end for fine grain data will ALWAYS trigger an
> > event to add the data set.
> >
> > To avoid this, I might include a flag in the event whether to stop
or
> > go on to the next command. But this raises the question - can't I do
> > this anyway with a call to the event dispatcher? The value of having
> > sequence commands seems to be the ability to move to the next
sequence
> > without the sequence being hardcoded. Yet this functionality doesn't
> > really exist - it is hidden by the front controller.
> >
> > Could someone set me straight here?
> >
> >
> >
>
>
>
> --
> Ralf Bokelberg [EMAIL PROTECTED]
> Flex & Flash Consultant based in Cologne/Germany
>


Reply via email to