FROM : Corey O'Connor
DATE : Mon Jul 24 23:32:19 2006
On 7/24/06, Michael Ash <michael.<email_removed>> wrote:
> Or you can just use NSCoder to do all the heavy lifting for you.
According to the documentation an NSCoder implementation calls -
(void) encodeWithCoder: (NSCoder*) on the object that was requested to
be serialized and initWithCoder on an object to be deserialized. The
object still has to determine how it's particular instance variables
should be serialized and de-serialized. As I understand it, no special
magic occurs to serialize and deserialize classes without relying on
the programmer of a class explicitly implementing routines to
serialize and de-serialize an instance of a class. Properly
serializing and deserializing an arbitrary object graph is not
something provided for free. Figuring out how to do that is also most
of the work of any data marshaling implementation IMO. To me, that
means that NSCoder does do any "heavy lifting". More like it: NSCoder
provides a nice framework for implementing data marshaling where the
specifics of marshaling an object's instance variables is left up to
the programmer.
The documentation points out that 10.1 and earlier supported the
serialization of arbitrary objects without explicit programmer
support, but is deprecated now. So I'll just say that it doesn't
exists. :-)
--
-Corey O'Connor
DATE : Mon Jul 24 23:32:19 2006
On 7/24/06, Michael Ash <michael.<email_removed>> wrote:
> Or you can just use NSCoder to do all the heavy lifting for you.
According to the documentation an NSCoder implementation calls -
(void) encodeWithCoder: (NSCoder*) on the object that was requested to
be serialized and initWithCoder on an object to be deserialized. The
object still has to determine how it's particular instance variables
should be serialized and de-serialized. As I understand it, no special
magic occurs to serialize and deserialize classes without relying on
the programmer of a class explicitly implementing routines to
serialize and de-serialize an instance of a class. Properly
serializing and deserializing an arbitrary object graph is not
something provided for free. Figuring out how to do that is also most
of the work of any data marshaling implementation IMO. To me, that
means that NSCoder does do any "heavy lifting". More like it: NSCoder
provides a nice framework for implementing data marshaling where the
specifics of marshaling an object's instance variables is left up to
the programmer.
The documentation points out that 10.1 and earlier supported the
serialization of arbitrary objects without explicit programmer
support, but is deprecated now. So I'll just say that it doesn't
exists. :-)
--
-Corey O'Connor
| Related mails | Author | Date |
|---|---|---|
| Jordan Evans | Jul 24, 15:19 | |
| Mark Papadakis | Jul 24, 15:24 | |
| I. Savant | Jul 24, 15:37 | |
| Jordan Evans | Jul 24, 15:38 | |
| Corey O'Connor | Jul 24, 19:30 | |
| Michael Ash | Jul 24, 23:05 | |
| Corey O'Connor | Jul 24, 23:32 | |
| Michael Ash | Jul 25, 00:56 | |
| Corey O'Connor | Jul 25, 03:15 |






Cocoa mail archive

