Got it. Thanks for the explanation. There were many discussions about the FronController just growing and growing. Do you happen to have a solution for refactoring? (For example, on a large project, when there are many developers working, all of them has to edit the FrontController to add an event.)
Andi e_baggg wrote: >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 > > > > > > > -- Andrea Varga Managing Partner / Project Manager Certified Macromedia Flash MX 2004 Developer -- Spin Development Srl Tel: +44 207 043 1304 Fax: +44 207 681 1376 Skype ID: vargaandrea Mon-Fri : 8 AM - 5 PM GMT+2 Saturday: 8 AM - 4 PM GMT+2 (Support only) ------------------------------------------ -- 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/