Method and apparatus for optimizing interface dispatching in...

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

C707S793000, C707S793000, C707S793000, C707S793000

Reexamination Certificate

active

06260045

ABSTRACT:

FIELD OF THE INVENTION
The present invention relates to the field of object-oriented programming. Specifically, the present invention relates to a method and apparatus for optimizing interface dispatching in an object-oriented programming environment.
BACKGROUND OF THE INVENTION
In object-oriented programming, an “object” is a software package that contains a collection of related procedures (or “methods”) and data (or “variables”). A “class” is a template that defines the methods and variables to be included in a particular object.
Once a base class is defined, any number of unique “instances” of the class may be created. The class defines the characteristics shared by all the instances, while the instance itself contains the information that makes the instance unique.
Inheritance is a mechanism whereby a new class of objects can be defined as a special case of a more general class. The new class automatically includes (or “inherits”) the method and variable definitions of the general class. Special cases of a class are known as “subclasses” of that class. In addition to the methods and variables they inherit, subclasses may define their own methods and variables and may override any of the inherited characteristics. Inheritance is thus essentially a mechanism for extending an application's functionality by reusing the functionality in the parent classes.
Interfaces are fundamental in object-oriented systems. Objects are known only through their interfaces. An object's interface characterizes the complete set of requests that can be sent to the object, or methods recognized and implemented by the object. An object's interface says nothing about its implementation, i.e. different objects are free to implement different requests differently.
“Implementation inheritance” defines an object's implementation in terms of another object's implementation, i.e. implementation inheritance defines a new implementation in terms of one or more existing implementations. Implementation inheritance is thus essentially a mechanism for code and representation sharing. In contrast, “interface inheritance” (or subtyping) describes when an object can be used in place of another, i.e. interface inheritance defines a new interface in terms of one or more existing interfaces.
FIG. 1A
illustrates an overview of object oriented programming concepts. Specifically,
FIG. 1A
illustrates two classes, Class A and Class B, each comprising multiple objects. Objects A
1
and A
2
are each instances of Class A and inherit all characteristics of Class A. Each object may also override any or all of the inherited characteristics. Similarly, Objects B
1
, B
2
and B
3
are instances of Class B and inherit all characteristics of Class B and may override any or all of the inherited characteristics. Class A also inherits from Interface X, where Interface X implements multiple methods. Class B inherits from both Interface X and Interface Y, where each interface implements multiple methods. Objects in Class A therefore recognize Methods X
1
, X
2
and X
3
, while objects in Class B recognize Methods X
1
, X
2
, X
3
, Y
1
, Y
2
and Y
3
.
In languages like C++, inheritance means both interface and implementation inheritance. The standard way to inherit an interface in C++ is to inherit publicly from a class that has (pure) virtual member functions. Pure interface inheritance can be approximated in C++ by inheriting publicly from pure abstract classes. Pure implementation or class inheritance can be approximated with private inheritance. In languages like Smalltalk, on the other hand, inheritance means implementation inheritance only. Instances of any class may be assigned to a variable as long as those instances support the operations performed on the value of the variable.
In contrast with C++ and Smailtalk, in a programming environment such as Java™, interface inheritance and implementation inheritance are treated distinctly differently. The issues facing a programmer in any of these object oriented programming environments, however, remain similar. The present specification assumes an interface inheritance mechanism implemented in Java. The description is, however, also applicable to a C++ or Smalltalk programming environment, with minor modifications.
Interface inheritance generally requires a mechanism to locate appropriate information about an interface with respect to the object being dealt with. For example, a mechanism is required to determine whether an object implements a specific method.
FIG. 1B
illustrates this problem conceptually. If “Method X
3
” is called in Object A
1
, then a method table, method table
100
, is accessed to determine whether Object A
1
may implement Method X
3
. In order to find Method X
3
, method table
100
is searched in a linear, sequential manner.
Thus, as illustrated in this example, the search goes through each method in method table
100
and locates Method X
3
. Then, based on the address for Method X
3
, the method can be invoked. Note that Object A
1
does not inherit from Interface Y, and thus half the methods in the method table are not applicable to Object A
1
. Given that a class can implement as many interfaces as a programmer chooses, searching for a specific method potentially involves checking all methods for each interface the object class implements for a match. This may result in a time-consuming loop to search for the item required.
SUMMARY OF THE INVENTION
The present invention discloses a method and apparatus for optimizing interface inheritance in an object-oriented programming environment. Specifically, an object specifying a method is examined and a class to which the object belongs is determined. A table of methods associated with the class is examined to locate the method specified by the object. An offset for a location of the interface within the class to which it belongs is determined, and the offset is cached in a class cache. The class cache is then examined when a next object is received to determine whether the interface associated with the offset in the class cache matches an interface specified by the next interface dispatch to an object of that class.


REFERENCES:
patent: 5542078 (1996-07-01), Martel et al.
patent: 5721854 (1998-02-01), Ebcioglu et al.
patent: 5765159 (1998-06-01), Srinivasan
patent: 5842220 (1998-11-01), De Groot et al.
patent: 5870742 (1999-02-01), Chang et al.
patent: 5872969 (1999-02-01), Copeland et al.
patent: 5960197 (1999-09-01), Segnan
patent: 5974256 (1999-10-01), Matthews et al.
patent: 6016495 (2000-01-01), McKeehan et al.
patent: 6066181 (2000-05-01), DeMaster

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

Method and apparatus for optimizing interface dispatching in... does not yet have a rating. At this time, there are no reviews or comments for this patent.

If you have personal experience with Method and apparatus for optimizing interface dispatching in..., we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and Method and apparatus for optimizing interface dispatching in... will most certainly appreciate the feedback.

Rate now

     

Profile ID: LFUS-PAI-O-2496122

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