摘要 |
Methods and apparatus are disclosed to facilitate and conduct the programming and implementation of object-oriented computer programs with improved object externalization and internalization. Program code allows an instance of a user-defined class to be viewed by other program elements as a block of memory containing one or more data items. The data items are the attributes of the object instance. An attribute map effectively describes the object instance by indicating, for example, the location of a particular attribute within the memory block. The attribute map may also directly or indirectly indicate, for example, the size of the attribute, the type of the attribute, and whether the attribute is rudimentary or aggregate in composition. Other program code, external to the object, uses a pointer to the object and the attribute map to externalize the object, i.e., transform the representation of an object to a secondary format. The secondary format may be used to convey the object outside the bounds of the program that contains it. Program code practicing the present invention makes a user-defined object more resilient to technology change. Because specific information about the external format used to represent the object is not integral to the object, a change in external format does not require a change to the object, and a class declaration (header) file for an object, together with its implementation file in executable form, can be made externalizable and internalizable to virtually an unlimited number of external formats.
|