Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!wugate!uunet!cimshop!davidm From: cimshop!davidm@uunet.UU.NET (David S. Masterson) Newsgroups: comp.object Subject: Re: Pre-computing objects Message-ID: Date: 26 Oct 89 17:47:30 GMT References: <4671be53.20b6d@apollo.HP.COM> Sender: davidm@cimshop.UUCP Distribution: usa Organization: Consilium Inc., Mountain View, California. Lines: 36 In-reply-to: vinoski@apollo.HP.COM's message of 25 Oct 89 20:23:00 GMT 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. I may have started that discussion (although I think there was one that predates me) and I still have seen a good answer to the problem in C++. In particular, I am attempting to use a relational database (with no object oriented features) in a C++ world. Therefore, structures (tuples from tables) come out of the database with no inheritance structure and we are trying to give them an inheritance structure. Thus far, we've had little success. The problem is pervasive as we are/will be running into the problem when moving objects between processes. The one advantage, though, in moving objects between processes is that at least they started with an inheritance hierachy and, therefore, its just a matter of wrapping the object up into a shippable form. The database (disk file, non-object oriented process), though, does not know of object hierarchies. In C++, the only type-safe, compile-time method for supporting this that I have found involves having parent objects knowing about their children's structure so that if they get such an object on their initializer function, they know what to do with it. There is a basic translation mechanism that must be invoked somewhere and, no matter what I have tried to do, I have only succeeded in moving the problem from one layer of objects to another. Anyone have any ideas? -- =================================================================== David Masterson Consilium, Inc. uunet!cimshop!davidm Mt. View, CA 94043 =================================================================== "Nobody here but us chickens..."