Method for object-oriented programming using dynamic interfaces

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

C711S170000

Reexamination Certificate

active

06237044

ABSTRACT:

BACKGROUND OF THE INVENTION
The present invention relates to the allocation of memory in a computer at the application level. In particular, the invention relates to the allocation of memory in order to represent objects supported in an object-oriented programming environment.
The Component Object Module model (COM) is a language- and location-independent software specification. A general overview of COM and the closely related Object Linked and Embedding model (OLE) are presented below. COM and OLE are described fully in
Inside OLE
, by Kraig Brockschmidt, published by Microsoft Press (1995, 2d Edition), and in the references listed therein. The Brockschmidt reference is incorporated by reference. However, the Brockschmidt publication is not prior art.
As the C++ language is the object-oriented programming language currently enjoying the greatest acceptance among object-oriented programmers, this invention is described in C++. Of course, any language capable of to adhering to the CON standard can realize this invention and its benefits.
CON is a binary standard whose primary characteristic are objects and the interfaces associated with particular objects. An interface for an object is a set of functions for manipulating the object. A single object typically has several interfaces. C++ can very conveniently represent COM objects and interfaces (COM classes) with C++ classes.
The defining of a COM class proceeds in two steps: the first is the defining of the instance data of the object class. The second step is the defining of a class for each of the object class' interfaces.
Interface implementations are C++ classes derived from an abstract interface definition.
FIG. 1A
schematically illustrates the layout of an example COM object
1
A
00
, according to the conventional COM implementation. The object
1
A
00
contains some infrastructure, such as a pointer
1
A
10
to a controlling unknown interface and a reference counter
1
A
20
. The object
1
A
00
also includes application data
1
A
30
. Further, there is a pointer
1
A
40
for each interface which the object
1
A
00
supports, including the requisite IUnknown interface. (Each pointer
1
A
40
points directly to the vtable implementing the interface.) For each interface which the object
1
A
00
supports, the conventional implementation allocates a corresponding object
1
A
50
for the interface. This conventional and convenient implementation of COM interfaces takes advantage of C++'s virtual function capability.
However, the conventional implementation has a number of deficiencies. Objects such as sample object
1
A
00
are allocated and initialized at application start-up and remain in the memory of the application, despite the fact that the application may never use the object and despite the fact that, at any given time, the application will not use most objects. Therefore, the conventional implementation incurs the memory costs of one pointer
1
A
10
to a controlling interface, the reference counter
1
A
20
, pointers
1
A
40
and one object
1
A
50
for each interface supported for an object.
Accordingly, a goal of this invention is the reduction of the memory costs of implementing COM objects.
Another goal of the invention is the simplification of the programming interface to COM and the elimination of a substantial amount of the repetitive infrastructure of conventional COM.
Yet another goal of the invention is to relieve individual designers of the need to devise complicated schemes to reduce memory consumption.
SUMMARY OF THE INVENTION
The invention is an apparatus and method for allocating, linking and using separate blocks of memory to represent the application data and the object-oriented programming model infrastructure of a data object. The invention includes referencing an object, allocating an object wrapper and then binding the object wrapper to the object.
The invention is particularly useful in the COM programming model. There, an object wrapper preferably includes the address of the object, the address of a description of the class of the object, the address of the controlling unknown of the object and the reference count for the object.
In a preferred embodiment, this first system maintains descriptions of each object class available in the system. The binding involves selecting from these multiple descriptions that description describing the object class of the object referenced and then linking the object wrapper and the selected description together.
In preferred embodiments, the object wrapper implements only one interface, the IUnknown interface, and is termed the IUnknown Wrapper.
When the object is queried for an interface (other than the IUnknown interface), the description of the object class is searched for the function table of the desired interface. If the interface exists, a second object wrapper, an Interface Wrapper, is allocated and initialized. The address of the Interface Wrapper is returned as the result of the query.
The Interface Wrapper is used to emulate invocation of a function from the function table of the desired interface. The call frame generated by the compiler for the Interface Wrapper function actually invoked is modified to replace a pointer to the Interface Wrapper with a pointer to the object. The function whose invocation is being emulated is then executed.
By eliminating the conventional vtable pointers, reference counters, controlling unknown pointers and other overhead from the data objects and instead temporarily allocating these structures in wrappers while an object is in use, the invention reduces the memory cost of modeling data objects as COM objects.
Also, the invention defines classes by explicitly stating their instance data and providing a set of independent interfaces. Accordingly, the invention simplifies the programming interface to COM and eliminates much of the infrastructure of conventional COM.


REFERENCES:
patent: 5297284 (1994-03-01), Jones et al.
patent: 5485617 (1996-01-01), Stutz et al.
patent: 5581760 (1996-12-01), Atkinson et al.
patent: 5608909 (1997-03-01), Atkinson et al.
patent: 5682536 (1997-10-01), Atkinson et al.
patent: 5692184 (1997-11-01), Ardoin et al.
patent: 5799191 (1998-08-01), Moriyasu et al.
Harrison, William et al., “Subject-Oriented Programming (A Critique of Pure Objects)”,ACM Sigplan Notices, 28:10 pp. 411-428 (1993).
North, Ken, “Understanding OLE”,DBMS, p. 10 (Jun. 1995).
Rogerson, Dale, “Calling COM Objects with Interface Wrappers”,Microsoft Developer Network Library(CD ROM), pp. 1-8(Oct. 1995).
William, Sara et al., “The Component Object Model”,Dr. Dobb's Special Report, 16:14-22 (Winter 1994/95).

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 for object-oriented programming using dynamic interfaces 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 for object-oriented programming using dynamic interfaces, we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and Method for object-oriented programming using dynamic interfaces will most certainly appreciate the feedback.

Rate now

     

Profile ID: LFUS-PAI-O-2522226

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