System for persistent and delayed allocation object reference in an object oriented environment

A data structure and method for uniquely identifying, and optimizing access to, object instances in an object oriented programming environment on a data processor containing a memory. Objects are categorized into one or more classes which define the method of the categorized objects, and messages are sent by the data processor to objects to perform actions. The data structure consists of a persistent portion containing a unique object identifier and a non-persistent portion containing the access address of an instance data frame in memory. The access address is set to the address of the instance data frame control block when the message is sent in order to optimize subsequent messages to the same object instance. The instance data frame control blocks are not allocated in memory until a first message is sent to an instance.

CROSS-REFERENCE TO RELATED APPLICATION 
The present application is related to a co-pending patent application 
entitled, "A Messenger and Object Manager to Implement an Object Oriented 
Environment" Ser. No. 602,442. These applications have a common assignee 
and contain some common disclosure. 
BACKGROUND OF THE INVENTION 
The field of the invention relates generally to an object oriented 
programming environment. More particularly, the invention relates to an 
Object Reference data structure that enables operation within an object 
oriented environment. 
This section provides a brief description of object oriented computing 
system concepts which are pertinent to the present invention. A more 
detailed description of the concepts discussed in this section can be 
found in a number of references, including Object-Oriented Systems 
Analysis by Sally Shlaer and Stephen J. Mellor (Yourdon Press Computing 
Series, 1988), Object Oriented Design With Applications by Grady Booch 
(The Benjamin/Cummings Publishing Company, 1990) and Object Oriented 
Software Construction by B. Meyer, (Prentice Hall, 1988). 
In object oriented programming systems (OOPS), "messages" are sent to 
"objects". There are two parts to a message. The parts are: (1) Object (2) 
Action. The object of the message simply identifies the piece of data that 
comprises a specific object, called an "instance". The action specifies 
what to do to with that data. 
In order to operate within an OOPS environment, it is necessary to have 
what is know as an Object Identification (OID) or Object Reference (

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
The purpose of the Object Reference is to uniquely identify an object 
instance, regardless of whether it is located in memory or in the 
database. The Object Reference operates with instances in either location. 
The Object Reference, operating with an Object Manager and Messenger in an 
object oriented programming system, allows objects to be automatically 
materialized into memory when they are actually invoked. Before describing 
the structure and examples of use of the Object Reference, an overview of 
an object oriented environment and the operation of its principal 
interrelated components, Object Reference, Object Manager and Messenger, 
is presented. 
As shown in FIG. 1, an object oriented programming environment contains a 
computer program 138 which operates on a computer platform 102. The 
computer program 138 includes an application program 130 and an object 
oriented programming system 136. 
The computer platform 102 includes hardware units 110 including a central 
processing unit (CPU) 114, a main memory (RAM) 112, and an input/output 
interface 116. 
The computer platform 102 also includes microinstruction code 108, an 
operating system 106, and a database manager 104. Various peripheral 
components may be connected to the computer platform 102, such as a 
terminal 120, a data storage device 124, and a printing device 128. The 
data storage device or secondary storage 124 may include hard disks and 
tape drives. The data storage device 124 represents non-volatile storage. 
External databases 134 are stored on the secondary storage 124. In object 
oriented programming systems the operating system uses virtual memory and 
manages all paging. 
Users 132 interact with the computer platform 102 and the computer program 
138 via terminal 120. 
In a preferred embodiment of the present invention, the computer platform 
102 includes a computer having an IBM System 370 architecture. The 
operating system 106 which runs thereon is an IBM Multiple Virtual Storage 
(MVS). The database manager 104 is an IBM DB2, which is a relational 
database manager. Also, the computer program 138 is preferably written in 
Intermediate C, which is an object oriented dialect of the C computer 
programming language. Intermediate C is similar to the C++ computer 
programming language. 
FIG. 2 presents a graphical representation of an object 202. The object 202 
contains data 214 (also called attributes) and the actions 204, 206, 208, 
210, 212 (also called methods). Generally, methods are categorized as 
functions or procedures. A function is a type of code that will return a 
result. Normally a function tends not to modify the state of the 
parameters given. 
As shown in FIG. 2, the object 202 is modeled by a doughnut, with the data 
214 being in the center of the doughnut. The data 214 represent various 
attributes of the object 202. The color of one's eyes, date of birth, 
name, etc., could be attributes of an object representing a person. Around 
the outer part of the doughnut, are the actions (also called methods) 204, 
202, 208, 210, 212 to be performed on the data 214. 
Object oriented programming systems categorize objects into classes. Thus, 
a class defines the features of its objects. A feature is either a method 
or an attribute. Features can be either exported, i.e., other methods can 
call them, or features can be non-exported, i.e., they can not be called 
except by a within-class method. An instance is a specific object with the 
features defined by its class. 
An object has an arbitrarily unique value when using the example of 
doughnuts representing objects of the same type of class. The outer part 
of the doughnuts which represent the actions or functions of the instance 
objects are arranged identically for each of the objects in the particular 
class. Similarly, the data in the inside of the doughnuts is identically 
structured. Therefore, if two objects are of the same type, their 
structures are identical except for the actual data or attribute values. 
The functions or actions to be performed on the data totally surround the 
data and in a sense encapsulate the data. Conventionally, the only 
programming that is allowed to know anything about the data are the 
functions or the routines in the outer part of the doughnut. This form of 
data encapsulation is not exclusive to object oriented programming. The 
basic idea behind data encapsulation is to minimize the number of system 
pieces that one must understand to form a particular set of data 
attributes. 
The functions encapsulating a specific object are the only elements that 
know or care what the encapsulated data looks like. The functions isolate 
the encapsulated data from other parts of the system. Therefore one ends 
up with ultimate flexibility over time to change the data of an object in 
any desired fashion. Optimally, one is capable of modifying the system as 
technologies change, by merely changing the data. Alternatively, the 
product is portable. It can be moved from a relational data base to a 
hierarchical data base, or to a PC having no particular data base at all. 
A user is only required to change pieces of the internal data. An object 
only needs to be concerned about how it represents the data for which it 
is responsible. This is fundamental to an object oriented environment, 
since it is a large, portable software product. 
The Object Reference defined for use within an object oriented programming 
environment is a data structure as shown in FIG. 3. Object Reference 300 
represents the pointer to an arbitrary object within the object oriented 
programming environment. By comparison, C uses the address of a piece of 
data as the pointer to the beginning memory location of that data, and 
stores this address in a variable of type pointer. An object oriented 
programming system also uses a pointer to each piece of data, which is 
called an object, and stores this pointer in a variable called an Object 
Reference (