• 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: Implementing Object persistence
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Implementing Object persistence


  • Subject: Re: Implementing Object persistence
  • From: Steven Kramer <email@hidden>
  • Date: Sun, 9 Jan 2005 22:23:12 +0100


Op 9-jan-05 om 20:18 heeft Will Mason het volgende geschreven:

  OTOH, if you need an extensible and future-safe archiving format,
NSKeyedArchiver is the better option. NSArchiver doesn't really work
too well with changing requirements. E.g. if you need to add new
fields to your objects, you have to account for that manually with
NSArchiver, while NSKeyedArchiver will just ignore keys you don't
request, and give you NIL on keys that aren't there.

I agree that NSKeyedArchiver is better for small archives where performance is not an issue for exactly the reasons that you cite above. However, I do believe that the advantages of keyed archives are exaggerated in the documentation, while the disadvantages of them are not mentioned at all. That's a bit weird. Also, Java has been using (very heavily) a serialization protocol very similar to non-keyed archives for years, and it's not wreaking irrevocable havoc on people's ability to serialize object graphs. They have specific rules for preserving the ability to serialize/deserialize objects across versions, and it appears to work quite well. I guess my point is that I feel that keyed archives are somewhat oversold in the documentation and I don't understand why. I would be interested to hear testimonials about how great they are, rather than simply the assertions of their superiority that we read in the documentation.


I had to move back to NSArchiver for performance reasons (as I've mentioned here earlier). But NSKeyedArchiver is far easier to use and your code is more bug-resilient.


So I think we all agree, really :-)


Regards,

Steven Kramer

--
email@hidden
http://sprintteam.com/

_______________________________________________
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: Implementing Object persistence (From: Will Mason <email@hidden>)

  • Prev by Date: Re: Ghost value in NSUserDefaults
  • Next by Date: Re: Communicating from kernel extension to application?
  • Previous by thread: Re: Implementing Object persistence
  • Next by thread: Re: Implementing Object persistence
  • Index(es):
    • Date
    • Thread