Re: [flexcoders] Cairngorm ModelLocator array filter...
Wow liked both the solutions. One is to make a copy and then add the filter function and the other one is to add the filer function in command. Great thanks. On Mon, Apr 14, 2008 at 3:26 PM, gabriel montagné [EMAIL PROTECTED] wrote: On Mon, Apr 14, 2008 at 12:49 PM, hworke [EMAIL PROTECTED]kanpsack%40gmail.com wrote: Hi I am using Cairngorm and in my ModelLocator I do have an array. I want to filter that array with a filter function. My question is where do I put this filter function: in a separate file or in the ModelLocator class? I personally (and the other guys on my team) we like to keep the models with absolutely no logic at all. The beauty of the command pattern is that all the logic is kept in small, discrete classes, all nicely tucked into their appropriate packages. If we need to setup sorts and filters or whatever on the data on the model, we do it from the commands that set that data initially. If you do need to keep changing that filter from time to time, I would further abstract it into another event + command pair. Once we did a search like that. We had a package of commands for processing search that would be in charge of taking the query and use it to build the custom filters and sorts for the catalog data. Hope this helps, G. -- gabriel montagné láscaris comneno http://rojored.com t/506.8392.2040
[flexcoders] Cairngorm ModelLocator array filter...
Hi I am using Cairngorm and in my ModelLocator I do have an array. I want to filter that array with a filter function. My question is where do I put this filter function: in a separate file or in the ModelLocator class?
Re: [flexcoders] Cairngorm ModelLocator array filter...
depends on your architecture and what feels best in your project. Problem with filtering an ArrayCollection directly in the model is that any views bound to that model will also be filtered. Usually I have a large dataset in an ArrayCollection in the model, and have a view that might have a search box that filters items in a list. I create a new ArrayCollection in that view, set the arrayCollection.source = modelLocator.dataArrayCollection.source, and then apply a filterFunction to the local arrayCollection specific to that view. That way each view has ways of filtering its own local ArrayCollection wrapper around the same data set in the model. But to each their own. Depends on how shared the data is and how you like to keep things divided On Mon, Apr 14, 2008 at 1:49 PM, hworke [EMAIL PROTECTED] wrote: Hi I am using Cairngorm and in my ModelLocator I do have an array. I want to filter that array with a filter function. My question is where do I put this filter function: in a separate file or in the ModelLocator class?
Re: [flexcoders] Cairngorm ModelLocator array filter...
On Mon, Apr 14, 2008 at 12:49 PM, hworke [EMAIL PROTECTED] wrote: Hi I am using Cairngorm and in my ModelLocator I do have an array. I want to filter that array with a filter function. My question is where do I put this filter function: in a separate file or in the ModelLocator class? I personally (and the other guys on my team) we like to keep the models with absolutely no logic at all. The beauty of the command pattern is that all the logic is kept in small, discrete classes, all nicely tucked into their appropriate packages. If we need to setup sorts and filters or whatever on the data on the model, we do it from the commands that set that data initially. If you do need to keep changing that filter from time to time, I would further abstract it into another event + command pair. Once we did a search like that. We had a package of commands for processing search that would be in charge of taking the query and use it to build the custom filters and sorts for the catalog data. Hope this helps, G. -- gabriel montagné láscaris comneno http://rojored.com t/506.8392.2040