Re: Why is it like this?
Re: Why is it like this?
- Subject: Re: Why is it like this?
- From: Sherm Pendley <email@hidden>
- Date: Tue, 31 May 2005 09:51:14 -0400
On May 30, 2005, at 10:57 PM, Andy Lee wrote:
I have an inheritance hierarchy of model objects. Lists of those
objects get displayed in different ways in various places
throughout my UI. It would be convenient for the objects to have
methods like -stringToDisplayInXYZBrowser and -
stringToDisplayInABCContextualMenu, but this means model objects
would be aware of the specific views they will be displayed in. I
*might* be able to put the display methods into an informal
protocol, and implement them in categories of my model objects.
I'm considering that for a future refactoring, but right now I'm
using lightweight wrapper objects around the model objects.
Not really sure what your overall design is, but isn't that pretty
much the situation that the NSFormatter and/or NSValueTransformer
classes were made for? They both act as intermediaries whenever
there's an "impedance mismatch" between what the view needs, and what
the model provides.
sherm--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden