Cairngorm as a framework is pretty loose in that it allows you to shortcut parts that may not feel right to you, and you can subclass and of the pieces to expand on the implementation. The Universal Mind extension is a good example of this:
http://code.google.com/p/flexcairngorm/ There have been quite a few threads on flexcoders about Cairngorm and MVC and everyone's personal(and sometimes evangelical) beliefs. Personally, I don't normally store view state in the model like the store does with its "selectedItem". I think where you may be losing the concept of events/commands is with server side vs client side changes. Usually an event is dispatched and a command is triggered when a data operation occurse such as a find or a save that will invoke the "backend". That doesn't necessarily mean the server as you could be writing an AIR application that communicates with the local SQLLite database, but the application doesn't care down to the delegate layer that will route the data to the correct "backend", whatever service that may be. In the store example the selectedItem is only useful for views so the views modify and bind to that variable on the model. I usually try to leave that kind of view only data out of the model and pass it around in the application where necessary instead. It sounds like you understand most of the concepts but just take exception to certain parts of the framework, which is fine. Use it however you see fit, if you're at odds with a framework then it's not going to be a pleasant development experience. As far as your question about the get commands, most of the time you will see separate events and commands for each set of 'domain' objects you deal with. Sometimes there is a need to load a ton of data up front, and you could have an init function that fires all of the appropraite get commands. Most of the time it's probably better to delay getting certain pieces of data until the user navigates to that section of the app. The event=command=server request is just part of the MVC pattern and keeps some nice separation so you dont have one monolithic event and command requesting and parsing all of the data. Keep in mind one of the biggest pros of using a framework is maintenance. If you're having a problem with your products list not loading correctly, you'll know to look in the chaing of the GetProductsEvent, GetProductsCommand, and ProductDelegate rather than digging through thousands of lines in a single command. On Thu, Jul 10, 2008 at 9:10 AM, oscar.12321 <[EMAIL PROTECTED]> wrote: > Yes. I know this diagram and, as i said, i have been browsing and > reading all over Internet, including forums, articles, tutorials, etc. > > My questions remain unsolved. For example, i see no arrows from view > to model like the Cairgorm Store sample does. > > Anyway, thank you. > > --- In [email protected] <flexcoders%40yahoogroups.com>, "Douglas > Knudsen" > > <[EMAIL PROTECTED]> wrote: > > > > have a go at this > > http://www.cairngormdocs.org/tools/CairngormDiagramExplorer.swf > > > > DK > > > > On Thu, Jul 10, 2008 at 7:37 AM, oscar.12321 <[EMAIL PROTECTED]> wrote: > > > I have the past few days reading about Cairngorm and, at all, i don't > > > understand the concept behind de events and commands. > > > > > > The people says that a event-command pair corresponds to a user > > > gesture or system event: clicks, app init, etc. But when i browse the > > > Cairngorm store app i found things like these: > > > > > > - Command modifies the model and the model notifies the view throw > > > bindings: this seems logic to me. > > > > > > - Selecting a product in the view directly changes the > > > model.selectedItem: where is the command?. What we have here is a user > > > gesture and a model update without Cairngorm event or command. > > > > > > - Retrieving the products with a GetProductsCommand: what kind of > > > event+command is this?. The system event shold be appInit or the like, > > > and then usually you need to retrieve many things, not only products. > > > Why server request = command? > > > > > > - Finally, the checkout process is divided in a sequence of commands. > > > The user gesture is checkout, but the app uses serveral commands. > > > > > > This has no sense for me. I think the theory was right, but when > > > applied is twisted to match the framework limitations. > > > > > > This is suposed to be the mother of the samples (an the only one, i > > > think). > > > > > > Could any one clarify me when to use a command an how to explain the > > > concept to other people? > > > > > > Thanks > > > > > > - Oscar > > > > > > > > > > > > > > -- > > Douglas Knudsen > > http://www.cubicleman.com > > this is my signature, like it? > > > > >

