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