Thank you for your responses.

I had thought about utility classes - just wasn't sure how that fitted within cairngorm.  I think both methods make sense but using utility classes probably fits cairngorm better than having methods inside the model.

But, then again - do what works - even if it isn't cairngorm by the book.

Sammi

jamesdustinmercer wrote:

I don't see anything wrong with the approach you are taking. I do
the same thing (that's probably why I don't see anything wrong with
it :). I think of it this way, if the methods you need to add
directly correspond with the data, and they are ambiguous of any
commands or other business logic, then the model locator is not a
bad place for it. I also add methods to encapsulate the adding,
removing, and updating of items (when I need to validate the data
coming or getting updated, standard setter getter type stuff...)

But as someone else said, utility classes are also good. You just
have to feel out when you need to do either one. A utility class
could be good in this situation because it will save you from
writing repeating lookup code for each different collection in the
ModelLocator.

Dustin Mercer

--- In [EMAIL PROTECTED]ups.com, Samúel Jónasson <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> what is the recommended way when many commands need to do perform
the
> same action on a model.
>
> - Do I write the methods in my model?
> - Do I make special commands for this? If so, how would I call
these
> commands from other commands?
> - Do I do this some other way?
>
> In my case the model is a collection of VO in an ArrayCollection.
Each
> of these VO have an ID variable. Many of my commands get an ID
> parameter and must be able to locate the VO in the model based on
this
> parameter. So in this particular case I want to write a method
that
> takes an ID and returns a reference to a VO in the model. Where
should
> this method go? I realize that the model should be strictly data
and
> commands should act on the data. So, commands, model, other? How
to?
>
> Best,
> Sammi
>


__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to