The example has good intentions.  Anytime you can reduce the amount 
of code in an application it's good, right?  Not always.  One of the 
main strengths of the Cairngorm framework is simplicity.  What the 
example refers to as a big downside, exists for a reason; 
simplicity.  By having one-to-one relationships, between 
CairngormEvents and Commands, it is easier to organize and maintain 
the events.  Not that you have to, of course.  However, in a typical 
use case the get, add, update and delete CairngormEvents would each 
use a different VO.  The get VO would contain Select parameters, 
while the update VO would contain fields and/or instructions.  The 
example would have to conditionally check the type of the event, to 
determine the appropriate VO to pass on to the command.  Certainly 
an option, but conditional coding can be avoided by keeping the 
separate actions in separate classes.  This keeps things simple, 
while enforcing encapsulation and promoting reuse.  CairngormEvents 
can always placed in different "events" sub folders to increase 
orginization.

As far as extending the FrontController (same applies to the 
ModelLocator), when classes get too big, break them apart into 
smaller pieces.  The FrontController does nothing more than lookup 
the Command name to execute.  Sub classing the FrontController 
wouldn't affect performance.  These issues are more related to data 
transfer, command methods (functions) and rendering.

-TH

--- In flexcoders@yahoogroups.com, Andrea Varga <[EMAIL PROTECTED]> wrote:
>
> e_baggg wrote:
> 
> >Andi-
> >  Tom was referring to having a hierarchy of FrontControllers.
> >
> >He happens to have a class called "CoreController" which all of 
his
> >Flex apps would use. Then, each Flex app will have it's own
> >FrontController that extends CoreController...this way each 
developer
> >has their own controller. This assumes of course there's 1 
developer
> >working on a project. The CoreController would house the common
> >Commands such as Login, Logout, and similar things.
> >
> >If you're in the situation where you have 1 large Flex app that 
has 1
> >large controller that all the developers are fighting for...I 
would
> >suggest that users update the Contoller and check in their empty
> >Command classes right away. Then begin development. That way if it
> >takes them 2 days to implement the logic for an event, they won't 
have
> >a lot of contacts. Another option is to make one developer 
the 'owner'
> >of the front controller and have other developers e-mail them the 
line
> >of code for the command.
> >  
> >
> Thank you.
> I just wasn't sure this is the right way to do it. I mean, that 
cannot 
> be more than one FrontController/project. It seems, this is the 
only 
> solution.
> The problem I'm having with this is not regarding the 'owner', 
with a 
> version control system that's not a problem.
> But the FrontController gets bigger and bigger, and less managable 
> (although there is nothing much to manage :), just a bunch of  
> addCommands :)), and I don't know weather this could cause 
problems or 
> not (regarding speed for example).
> 
> Andi
> 
> 
> >--- In flexcoders@yahoogroups.com, Andrea Varga <andi@> wrote:
> >  
> >
> >>Tom Chiverton wrote:
> >>
> >>    
> >>
> >>>On Wednesday 30 August 2006 13:14, Andrea Varga wrote:
> >>> 
> >>>
> >>>      
> >>>
> >>>>(For example, on a large project, when there are many 
developers
> >>>>working, all of them has to edit the FrontController to add an 
event.)
> >>>>   
> >>>>
> >>>>        
> >>>>
> >>>This isn't a problem with a decent RCS.
> >>>
> >>>As it is, we've got a CoreController and then indivdual projects
> >>>      
> >>>
> >extend that 
> >  
> >
> >>>to make their application specific events.
> >>>
> >>> 
> >>>
> >>>      
> >>>
> >>Could you please tell me where can I found more about this? I 
cannot 
> >>find anything. Thanks.
> >>
> >>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/
 



Reply via email to