Andi-
  Nothing changes with the FrontController and Commands. You would
still have 3 separate commands (1 each for add, update, delete).

Remember, the generic CairngormEvent classes calls:
"super(commandName)" ....

so the dispatchEvent() for each call would like this:

 dispatchEvent(new WidgetEvent(WidgetFrontController.ADD_WIDGET,
widgetVO));
 dispatchEvent(new WidgetEvent(WidgetFrontController.UPDATE_WIDGET,
widgetVO));
 dispatchEvent(new WidgetEvent(WidgetFrontController.DELETE_WIDGET,
widgetVO));

and each Command will apropriately be called just like it was. The key
 is we're no longer hard-coding the "WidgetFrontController.ADD_WIDGET"
into each CairngormEvent sublcass.

--- In flexcoders@yahoogroups.com, Andrea Varga <[EMAIL PROTECTED]> wrote:
>
> e_baggg wrote:
> 
> >Hello group-
> >  I hadn't seen a previous post regarding this explicity so I wrote a
> >small blog about it. It helps reduce the #of classes that get created
> >when using Cairngorm (a big issue with me since the client is VERY
> >picky with their swf file sizes). This blog shows the code for usuing
> >a reusable CairngormEvent versus creating separate classes for each
> >dispatchable event.
> >
>
>http://ebaggg.blogspot.com/2006/08/cairngormevent-anti-pattern-we-all.html
> >
> >Thoughts?
> >
> 
> The ideea is good, but how do you handle them further?
> Will you have 3 different commands associated with the same event? And 
> each Command will start with an if statement, to see if that's the
event 
> he supposed to answer to? Doesn't seem right.
> 
> Andi
>







--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to