While I am sure there are others, the first thing that comes to mind concerning your first question is something I did just the other day. Say you've got a command that you want to execute when you receive data back from a remote call. For debugging or other purposes, you now want to be able to execute that command manually, by clicking a button. Using FrontController and the traditional Cairngorm approach, all you have to do is dispatch the event in the click handler. Without FrontController you have to import, instantiate and call execute() on your Command class. Not to mention you now have instances of your Command class scattered about.
Or what if you decide that a Command that is called in various places should be named differently or changed in some other way? Using FrontController you greatly minimize the places in which you need to edit your code. I suppose if you never need to execute the same Command in response to more than one type of event (generally speaking, not Event), then your approach would be fine. As I understand it, Cairngorm generally advocates making remote calls from your delegate classes, not commands. Again, the main advantage I see here is code centralization. You might have five different commands that all need to call the same remote method. If something changes and you need to call that method with different arguments or need to call a different method altogether, using a delegate means you change your code once instead of five times. I am still a relative newcomer to Flex and Cairngorm but the main advantages I've seen and loved so far are the things I've mentioned here; code centralization, defined responsibilities and clear separation of duties for the pieces of your app. Most of the time when I do question a methodology put forth by Cairngorm I simply fall back on the thought that its developers are way smarter and more experienced than myself so they probably have a good reason for whatever they did :) Sorry to ramble, HTH. Ben --- In flexcoders@yahoogroups.com, "jrjazzman23" <[EMAIL PROTECTED]> wrote: > > Hi, > > I've got a couple of questions on my mind that I'm hoping to get some > opinions on... > > First. I don't see what value the FrontController adds in Flex apps. > My initial thought was that it was important to prevent views from > coupling to specific commands. That really doesn't hold up though, > because the views are coupled to specifc events, each of which results > in a specific Command being executed. Since the FrontController > maintains a 1-to-1 map of Cairngorm events to Commands, why don't > views just run the commands directly? > > Next, we're moving most of our remote object calls into the model. > The logic that controls what parts of the model get persisted, when, > and in what order is complex, and our Commands had become huge and > full of logic. As a reuslt of the changes, lots of the classes in the > model now make remote calls and implement IResponder. I'm trying to > get back to the model of Command kicks off the "feature" and then gets > out of the way. Is there any rule with Cairngorm that says that > Commands must do the remote calls? Is it common to use something > other than a Command to make remote calls? > > > thanks > > Jeremy > -- 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/