| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On May 30, 2005, at Mon, May 30, 10:57 10 PM, Andy Lee wrote:
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.
One solution would be to have more abstract methods in the Model class - for example -shortString -longString. Then each view's Controller class would call -short/longString as needed.
So you might keep your hypothetical -stringToDisplay… methods in a hybrid Model-Controller class.
Not really sure what your overall design is,
Shape
Curve
Oval
Circle
Bezier
Polygon
Segment
Triangle
Quadrangle
Trapezoid
RectangleNow imagine your UI has:
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.
--Andy
_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/email@hidden
| References: | |
| >Re: Why is it like this? (From: Gregory Weston <email@hidden>) | |
| >Re: Why is it like this? (From: Thomas Davie <email@hidden>) | |
| >Re: Why is it like this? (From: Gregory Weston <email@hidden>) | |
| >Re: Why is it like this? (From: Thomas Davie <email@hidden>) | |
| >Re: Why is it like this? (From: Aaron Fothergill <email@hidden>) | |
| >Re: Why is it like this? (From: Andy Lee <email@hidden>) | |
| >Re: Why is it like this? (From: Raffael Cavallaro <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.