Re: Value Transformer with multiple Model Key Paths
Re: Value Transformer with multiple Model Key Paths
- Subject: Re: Value Transformer with multiple Model Key Paths
- From: Markus Spoettl <email@hidden>
- Date: Mon, 31 May 2010 01:07:27 -0400
On May 31, 2010, at 12:46 AM, Quincey Morris wrote:
> Your two proposals are both viable, and, in fact, neither of these solutions violates the MVC paradigm in any way. The property that you create doesn't add any knowledge of the actual UI to your data model, nor does it establish any special or privileged line of communication between the model and the view. It's just a property of the model -- "a color suitable for representing the current state of this object" -- that's available to any "client" of the model for whatever purpose. The returned color could (for example) be used as a key to a NSDictionary, if that happened to be useful somewhere else in the application.
>
> If having a color property is nevertheless distasteful, solution (a) is an equally valid alternative.
While that is all true it still adds a property to the model that only is necessary because someone would like to display an certain aspect of it in a some way.
That way it makes a connection of the model to a potential method of visualization. And that - in my opinion - generally* is the purpose of a view or controller (or maybe a category on the original class).
As I said I'm happy to give up that position when there's need for it, but I feel guilty all the time :)
Regards
Markus
(*) All kinds of exceptions apply.
--
__________________________________________
Markus Spoettl
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden