• 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: Correct MVC code placement
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Correct MVC code placement


  • Subject: Re: Correct MVC code placement
  • From: Ken Thomases <email@hidden>
  • Date: Sun, 14 Jun 2009 17:08:49 -0500

On Jun 14, 2009, at 2:34 PM, Chris Tracewell wrote:

On Jun 14, 2009, at 11:27 AM, Kyle Sluder wrote:

NSDocument is what's known as a "model-controller" object.  Your
actual model is the pipe-separated values; NSDocument allows you to
perform operations on that model.  As such, I'd probably expose an
NSArray property for my list of things, and only do the
pipe-separation when reading from or writing to disk.


Thanks Kyle, I should've noted this is a non-document based app. That said, I think your suggestion would imply to let the controller to expose its own array property of the model's pipe-separated property?

I think what Kyle meant is that your model is the values between the pipe separators. The pipe-separated string format is part of your file format. I don't know what your model represents, but I doubt that the pipe-separated string format is inherent to the thing which it represents. Rather, it seems like the sort of thing which is only part of the storage format.


So, I think the model itself should parse the storage format and expose its state in the more natural format for Cocoa -- an array property.

Cheers,
Ken

_______________________________________________

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


  • Follow-Ups:
    • Re: Correct MVC code placement
      • From: Chris Tracewell <email@hidden>
References: 
 >Correct MVC code placement (From: Chris Tracewell <email@hidden>)
 >Re: Correct MVC code placement (From: Kyle Sluder <email@hidden>)
 >Re: Correct MVC code placement (From: Chris Tracewell <email@hidden>)

  • Prev by Date: Re: Coming up with ideas
  • Next by Date: Re: Correct MVC code placement
  • Previous by thread: Re: Correct MVC code placement
  • Next by thread: Re: Correct MVC code placement
  • Index(es):
    • Date
    • Thread