On 29/08/2013, at 10:35 AM, Marcel Weiher <marcel.wei...@gmail.com> wrote:

>> Also, if you add a new class, the old application won't be able to 
>> de-serialize it from a keyed archiver.
> 
> Hadn’t thought of that one!  Er…I meant to say “completely obvious!!"


You can plan ahead for this eventuality though. A keyed (un)archiver can have a 
delegate which is able to substitute classes, rather than simply fail. If the 
new class can simply be ignored by the old app, then that's easy enough to 
accomplish without the old app having to know about the new class explicitly - 
it can just skip anything it has never heard of. The newer app, knowing that 
this is what older apps will do, can plan for that contingency, maybe by 
including a fallback object.

> So the whole automagic forward/backward compatibility that we’re supposed to 
> get with keyed archives doesn’t actually pan out.  If you want compatibility, 
> you have to plan and code for it, just like with old-style archiving.   And 
> ideally, you have an externally defined format.

Yes, you have to plan for it, but on a class-by-class basis, and only as 
necessary. It's not auto-magic, but it's generally pretty easy.


--Graham


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to