Re: How to get objects to not be encoded with NSArchiver
Re: How to get objects to not be encoded with NSArchiver
- Subject: Re: How to get objects to not be encoded with NSArchiver
- From: Chris Hanson <email@hidden>
- Date: Tue, 2 Apr 2002 18:22:17 -0600
At 1:36 AM -0700 4/2/02, Rosyna wrote:
I have a menu I'm archiving to a data stream with NSArchiver.
Why are you archiving the menu? You shouldn't be archiving View
objects unless you're writing an interface creation tool like
Interface Builder. Rather, you should be archiving the Model objects
that your human interface is providing a View to.
A good rule of thumb in Model-View-Controller design is to always
*populate* your human interface *from* data, don't *use* your human
interface to *store* data.
(Unfortunately, a lot of common class libraries don't do very much to
encourage Model-View-Controller design, even though they do support
it. This makes it hard for developers using those frameworks to
deliver on object-oriented development's promised benefit of reuse.
Cocoa is very different in that respect; it's easier to use MVC than
it is to try and make it work like other frameworks, which results in
more opportunity for reuse.)
-- Chris
--
Chris Hanson | Email: email@hidden
bDistributed.com, Inc. | Phone: +1-847-372-3955
Mac OS X & WebObjects Consulting | Fax: +1-847-589-3738
http://bdistributed.com/ | Personal Email: email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.