Method and apparatus for dispatch table construction

Electrical computers and digital processing systems: multicomput – Computer-to-computer data routing – Least weight routing

Reexamination Certificate

Rate now

  [ 0.00 ] – not rated yet Voters 0   Comments 0

Details

Reexamination Certificate

active

06393491

ABSTRACT:

FIELD OF THE INVENTION
The present invention relates generally to the field of computer software and software portability. In particular, it relates to the construction dispatch tables.
BACKGROUND OF THE INVENTION
To facilitate the following discussion, a brief overview of a conventional object oriented computing environment will be given. In an object oriented computing environment, an object refers to a software bundle of variables and related methods. An object maintains its state, i.e., what the object knows, in variables, and implements its behavior, i.e. what the object can do, in methods. Messages are the means by which software objects interact and communicate with each other. Collectively, variables and methods may be referred to as members. The variables and methods for an object are also referred to as instance variables and instance methods.
Typically, class variables and class methods are those variables and methods defined as belonging to a class. A class may be described as a reusable blueprint that defines the variables and the methods common to all objects of a certain kind. An instance is an object belonging to a class where memory is allocated for the instance variables in the class.
Classes may be arranged in a class hierarchy, or inheritance tree, in which the further down the hierarchy a class appears, the more specialized it is.
FIG. 1
is a block diagram representing a particular class hierarchy
100
. The class hierarchy
100
includes a Class A
102
including variables
104
and methods
106
. In the illustrated embodiment, Class A has a plurality of associated methods, including method M. The class hierarchy further includes Class B
110
which inherits from Class A, and Classes C, D and E (
112
,
114
and
116
respectively), which all inherit from Class B
110
. Each of the subclasses also include variables
104
and methods
106
.
A superclass refers to the class' direct ancestor as well as to all of its ascendant classes. A ‘direct’ superclass distinguishes the immediate parent superclass from the alternate ascendant superclasses in a class hierarchy. A subclass provides specialized behavior apart from the basis of common elements provided by the superclass. To do this, each subclass inherits variables and methods from the superclass. In addition, subclasses can add variables and methods to the ones they inherit from the superclass. For example, the class B
110
inherits accessible methods defined in its superclass (class A
102
), including the method M
108
. Class B may also define its own new methods, including method N,
109
in the embodiment shown. It is important to note that subclasses can also override one or more of its inherited methods and provide specialized implementations for those methods.
When a language allows classes to inherit from a single superclass, it is said to have a single inheritance. In contrast, when a language allows classes to inherit from more than one superclass, it is said to have multiple inheritance. In the class hierarchy illustrated in
FIG. 1
there is single inheritance since each subclass inherits from just one direct superclass.
In some languages, a superclass may be repetitively used through the practice of inheritance. Generally, a subclass inherits all of the methods from its superclass that are accessible to that subclass as they are unless the subclass explicitly overrides a method. Accessibility is determined by a combination of an accessibility declaration of the superclass member and an accessibility, declaration of the subclass member.
Accessibility is differentiated to facilitate a spectrum from unrestricted sharing of source code to specific forms of privacy. The two conventional types of accessibility levels are public and private. A public member can be seen or accessed by any other class. A private member can only be accessed by its own class. Particular languages may use additional accessibility types. For example, C++ uses a protected accessibility in which a protected member can generally only be accessed by its subclasses. Additionally, Java uses a package private accessibility in which a package private member can only be accessed by classes in a particular package. A package is a collection of related classes and interfaces that provide access protection and namespace management for all the elements of the package. Classes may be grouped into packages to make classes easier to find and use, to avoid naming conflicts, and to control access.
Generally, the accessibility of a message is specified upon declaration of the member. If no accessibility is initially provided, a default accessibility may be used. For example, within a Java package, the default accessibility for a member whose accessibility is not initially specified becomes package private.
FIG. 2
is a block diagram describing a class hierarchy, wherein each class in the hierarchy locally defines a method “foo”. Specifically, class A
202
belongs to a Package P
1
and contains a method ‘A.foo’
204
having an unspecified accessibility. In this case, the method A.foo
204
is defaulted to a package private accessibility with respect to Package P
1
. Similarly, class B
206
belongs to a Package P
2
and contains a method ‘B.foo’
208
having a public accessibility. Class C
210
belongs to a Package P
1
and contains a method ‘C.foo’
212
having a public accessibility. The methods
204
,
208
and
212
all implement the method “foo”, however, what differs between the three is their respective class, package, source code and accessibility. This difference may affect the behavior of the method, e.g. if the method calls source code for a print statement to announce the method's class, the three methods will have different outputs as illustrated.
Conventionally, every class and interface has a method table containing all the methods it locally defines. In addition, every class has a dispatch table, or Vtable, that has entries for all externally accessible methods that can be invoked by the class, including inherited methods. Typically private methods are not included in the Vtable. In conventional Vtable construction, every externally accessible method is associated with a single Vtable entry, which points to a section of code corresponding to a method. Thus, every Vtable entry points back at a method it corresponds to, whether local or inherited.
FIG. 3
is a block diagram illustrating a conventional format of a Vtable
300
corresponding to class B
206
of FIG.
2
. The Vtable
300
includes a superclass portion
302
which contains all the entries corresponding to methods inherited from the direct superclass (class A
202
) and a class portion
304
which contains the entries corresponding to the methods locally defined in class B
206
. The locally defined methods found in the class portion
304
are those which are new to class B
206
. For example, a new entry
306
which did not over-write an entry corresponding to a method from class A
202
is added in the class portion
304
and thus increases the size of the Vtable
300
. Alternately, locally defined methods that override a corresponding superclass method overwrite the existing Vtable entry in the superclass portion
302
. For example, an entry
308
of Vtable
300
which points to code for B.foo overwrites the corresponding entry in the superclass portion of Vtable
300
to point to the code for the locally defined method C.foo.
The Java programming language contemplates the use of single inheritance. In Java, a subclass is defined to inherit all of the accessible members of its superclass and ancestors and can use these members as is, hide them or override them. Subclasses inherit those superclass members declared as public or protected. In addition, subclasses inherit a superclasses' members declared with no access designation as long as the subclass is in the same package as the superclass (i.e. they both default to package private). Thus, Java flexibly provides an accessibility spectrum from unrestricted sharing of source code to co

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 dispatch table construction 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 dispatch table construction, we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and Method and apparatus for dispatch table construction will most certainly appreciate the feedback.

Rate now

     

Profile ID: LFUS-PAI-O-2885706

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