• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Why is it like this?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


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>)

  • Prev by Date: Re: DO behavior depends on server launch
  • Next by Date: Re: Tiger development Panther deployment
  • Previous by thread: Re: [digression] Why is it like this?
  • Next by thread: Re: Why is it like this?
  • Index(es):
    • Date
    • Thread