System and method for initializing variables in an...

Data processing: database and file management or data structures – Database design – Data structure types

Reexamination Certificate

Rate now

  [ 0.00 ] – not rated yet Voters 0   Comments 0

Details

Reexamination Certificate

active

06708181

ABSTRACT:

TECHNICAL FIELD
The present invention relates in general to data processing systems, and in particular, to a method for initializing variables within classes in an object-oriented programming environment.
BACKGROUND INFORMATION
Object-oriented programming implements programming techniques in an attempt to model real-world objects. An object is a software “package” that contains a collection of related procedures and data. Such procedures are called methods, and the data elements are referred to as variables. Objects interact with each other by sending each other messages requesting that they carry out their methods. A message is simply the name of an object followed by the name of a method the object knows how to execute. Therefore, object-oriented programming consists of a number of objects interacting with each other by sending messages to one another.
A class is a template that defines the methods and variables to be included in a particular type of object. The descriptions of the methods and variables that support them are included only once, in the definition of the class. The objects that belong to a class, called instances of the class, contain only their particular values for the variables.
FIG. 1
illustrates a class
100
having methods
101
-
105
and N variables.
Therefore, in an object-oriented programming system, objects are grouped into classes. The classes define the fields and methods that can be applied to an object. Object classes are organized into an inheritance hierarchy which defines how some object classes can inherit fields and methods and extend them with additional fields and methods. In addition to the inheritance hierarchy, classes and methods may use other classes and methods in their implementation.
Classes and objects may have fields which need to be initialized to the proper initial values. Object instance fields are initialized when an object is created. Class fields must be initialized before any object of the class is created or used. Classes must be initialized in a correct order. Many orders may be possible, but there are a set of constraints defined by the definition of the class which can be determined either by the programmer or at compile time.
Some languages, such as JAVA, dynamically load classes when they are first referenced and initialize the class when the class is dynamically loaded. For example, when the JAVA program gets loaded into memory, it is at that point that the variables are initialized. Some of the variables within a class may be already determined, but there may be some variables that are defined by some function, such as the square root of 2, which are performed by methods within other classes. To determine that variable, there is a call to that method (square root of 2 function) within another class object. The JAVA program will then have to load that class object into memory, and initialize its core variables.
In JAVA this is fairly straight forward because of the dynamic loading of the JAVA program. Other languages, such as C++, statically load classes and provide little to control the order of class initialization.
In a C++ program, the above method would require that all of the classes be loaded at the same time. One of the problems is that the order for initialization within C++ is not defined. A programmer can attempt to define a set of priorities for ordering the initializations, but if a circularity is encountered, there can be a difficulty in dealing with such a situation.
SUMMARY OF THE INVENTION
The present invention addresses the foregoing problems by defining a variable for each class indicating whether the initialization of the core values in that class have completed or are in progress, and by also incorporating an “importance level” parameter to each class initialization method. The importance level parameter ensures that each class initialization method initializes its BEFORE classes first, and then initializes the AFTER classes at a later time (BEFORE and AFTER are defined hereinafter). This allows the process to first initialize all important classes (where the definition of what is important is determined locally by the class and the situation), but still ensures that all reachable classes are initialized eventually before beginning the main method.
In one embodiment of the present invention a program method is implemented for initializing variables in each of a plurality of class objects created in a statically loaded object-oriented programming language. Within each of the class objects, messages are sent to BEFORE class objects to initialize their core variables. Also, within each of the class objects, initializing of the core variables is performed after all of the BEFORE class objects have initialized their core variables. BEFORE class objects are those class objects listed whose core variables need to be initialized before the core variables of the present class object. Within each of the class objects after the core variables have been initialized, AFTER classes may be initialized.
The foregoing has outlined rather broadly the features and technical advantages of the present invention in order that the detailed description of the invention that follows may be better understood. Additional features and advantages of the invention will be described hereinafter which form the subject of the claims of the invention.


REFERENCES:
patent: 5361350 (1994-11-01), Conner et al.
patent: 5590327 (1996-12-01), Biliris et al.
patent: 5644770 (1997-07-01), Burke et al.
patent: 5692195 (1997-11-01), Conner et al.
patent: 5694597 (1997-12-01), Cantin et al.
patent: 5729739 (1998-03-01), Cantin et al.
patent: 5787431 (1998-07-01), Shaughnessy
patent: 5966702 (1999-10-01), Fresko et al.
patent: 5995753 (1999-11-01), Walker
patent: 6003038 (1999-12-01), Chen

LandOfFree

Say what you really think

Search LandOfFree.com for the USA inventors and patents. Rate them and share your experience with other people.

Rating

System and method for initializing variables in an... does not yet have a rating. At this time, there are no reviews or comments for this patent.

If you have personal experience with System and method for initializing variables in an..., we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and System and method for initializing variables in an... will most certainly appreciate the feedback.

Rate now

     

Profile ID: LFUS-PAI-O-3191010

  Search
All data on this website is collected from public sources. Our data reflects the most accurate information available at the time of publication.