Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!purdue!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!apple!apple.com!chewy From: chewy@apple.com (Paul Snively) Newsgroups: comp.object Subject: Persistent Objects Was: Re: Pre-computing objects Message-ID: <4908@internal.Apple.COM> Date: 26 Oct 89 16:52:16 GMT References: <4671be53.20b6d@apollo.HP.COM> Sender: usenet@Apple.COM Organization: Apple Computer, Inc. Lines: 42 In article <4671be53.20b6d@apollo.HP.COM> vinoski@apollo.HP.COM (Stephen Vinoski) writes: > Some time ago a discussion arose in comp.lang.c++ about reading objects in > from, say, a disk file. There were several answers, but none that seemed all > that great, so I hope to start a discussion of the subject here. Good! The discussion that you're trying to start essentially revolves around what are usually called "persistent objects." Persistent Objects are almost as hard to define (let alone implement) as Object-Oriented Programming is. When I think of a persistent object, I think of an object that can be stored on disk (that includes both instance variables AND methods, folks) and, if it's the first object of its class to be so stored, the appropriate class information will be stored as well (out of necessity). Persistent objects should also be able to be read back in from disk, of course. This isn't by any means a trivial set of requirements. First of all, saving methods can be anywhere from tricky to impossible. As if that weren't bad enough, what happens if you save some object (and its associated class structure), and then try to read it back into a running system where the class structure is perhaps superficially the same (e.g. the class has the same name) but differs semantically--that is, it has new class/instance variables or new/different methods? (Picture a poor programmer running into the night, screaming...) Ok, so these are some of the more obvious challenges. I'd recommend looking at lots of OOPSLA proceedings to get some idea as to where to look next. I'd also recommend reading up on distributed object systems. By the way, C++ is one of the harder languages to do persistence in, in my opinion (compared to, say, Smalltalk or Common Lisp with CLOS). __________________________________________________________________________ Just because I work for Apple Computer, Inc. doesn't mean that they believe what I believe or vice-versa. __________________________________________________________________________ C++ -- The language in which only friends can access your private members. __________________________________________________________________________