Hi Kenny, 1.
NewScreenEvent - Hmm... This isn't a CairngormEvent - rather it extends flash.events.Event. It is used only in Checkout.mxml and its subcomponents. It makes sense to me to keep this within this part of the view as nothing else 'needs to know'. If something else did need to know I'd use a CairngormEvent/Command, change a property on the model, and let binding take care of updating the part of the view that needed to know. UpdateShippingCostEvent - I think that this may simply be a feature that has (intentionally?) been left unimplemented. I have the vague impression that I read something about this somewhere but Google doesn't find it anywhere... 2. There's been an interesting thread on this list lately entitled "Cairngorm’s Anaemic Domain Model". Have you seen it? http://tech.groups.yahoo.com/group/flexcoders/message/57803 It talks about how much logic to put on the model... > aren't we coupling the business logic to the view a little too tight? There's a lot of flexibility in Cairngorm to do things in different ways but much of what I'm seeing (in examples like CairngormStore, articles, and posts on this list) points to an approach where we keep the view fairly dumb and put client-side business logic on the model. That said, I can see how you'd think that one would keep sorting and filtering on the view. It certainly doesn't appear that anything else needs to know about how this view is sorted and filtered. I suspect that the store's authors simply concluded that its sorting and filtering logic were complex enough that they decided to put it in an object (Comparator) on the model. If you want to follow this approach in your app you might do something like the following: Create an object on the model that keeps track of selectedStates list and also maintains a displayStatesUS list in addition to your STATES_US constant. Every time the user drags a state have a command call a method on this object, which updates these two properties. Bind your dropdown to displayStatesUS. My 2c - I'm fairly new to Cairngorm... :-) Douglas ------------------------------------------------- Douglas McCarroll CairngormDocs.org Webmaster http://www.CairngormDocs.org Flex Developer http://www.brightworks.com 617.459.3840 ------------------------------------------------- lostinrecursion wrote: > > Hi all, > > I just had the pleasure of stepping through the Cairngorm Store (v2.0) > and checking it out. (I2, Great Work) > > I have two event questions regarding the store. > > 1. I notice that there are two events (UpdateShippingCostEvent and > NewScreenEvent) which do not map to a command in the Controller. What > is the motivation behind that? Meaning, is there a specific reason why > one would choose to have some events not handled by a command in a > Cairngorm app? > > 2. The other is separation of logic from presentation. There are two > events mapped to Commands in the controller (FilterProductsEvent and > SortProductsEvent) which are nothing more than view manipulation of > the data. By putting these in a command, aren't we coupling the > business logic to the view a little too tight? > > 2. (Explained) I ask number two because I have a Component in my > application that is a List with the US States in it. Users can drag > the states from the List and drop them in a grid, where I have setup > additional data entry capabilities. The state List dataProvider is a > "copy" of a model variable called STATES_US. The List is re-sorted and > filtered as states are pulled from it. (Essentially to prevent the > user from adding the same state twice) > > Following the logic of the Cairngorm Store, I would need to map an > event to a command and bounce it to the model. But in this case, > that's not possible since it is a component property we are sorting. > > Thanks for any insight you can offer. > > -- 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/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> 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/

