A method and apparatus for subclassing system object Model (SOM) class objects for a dynamic object-oriented language. A proxy class object is created using the dynamic language that points to the SOM class object. Next, a dynamic language subclass is created. This is followed by the creation of a SOM class object using the SOM interface, which causes certain SOM methods to be overridden by dynamic language redispatch stubs. The dynamic language overrides the SOM dispatch procedures and replaces the dispatcher with its own procedures. The new dispatch procedure will search for a method in the dynamic language class object method table first in response to a message, and if not found, redirects the message to the SOM environment.
|
1. A method, implemented in a computer system, for subclassing system object model objects in an object-oriented dynamic language, comprising:
providing a class object in a system object model environment having a unique name; creating a proxy class object in said dynamic language having a pointer to said class object in said system object model environment; creating a subclass in said dynamic language having the unique name of said class object in said system object model environment; and calling a dispatcher from said proxy class object for searching a method for said class object in said system object model environment.
13. A method, implemented in a computer system, for subclassing an object-oriented object created in a first development environment in an object-oriented dynamic language, comprising:
providing a class object in said first development environment having a unique name; creating a proxy class object in said dynamic language having a pointer to said class object in said first development environment; creating a subclass in said dynamic language having the unique name of said class object in said first development environment; and calling a dispatcher from said proxy class object for searching a method for said class object in said first development environment.
7. An apparatus for subclassing system object model objects in an object-oriented dynamic language, in a data processing system, comprising:
means for providing a class object in a system object model environment having a unique name; means for creating a proxy class object in said dynamic language having a pointer to said class object in said system object model environment; means for creating a subclass in said dynamic language having the unique name of said class object in said system object model environment; and means for calling a dispatcher from said proxy class object for searching a method for said class object in said system object model environment.
2. The method of
searching said system object model environment for said class object and a plurality of methods at or above said class object.
3. The method of
storing a stub method in said proxy class object for calling a system object model environment dispatcher for searching methods within said system object model.
4. The method of
creating a method table for said proxy class object having new methods for said dynamic language.
5. The method of
storing a method overridden by said dynamic language in said method table.
6. The method of
storing class data in said method table of said proxy class object.
8. The apparatus of
means for searching said system object model environment for said class object and a plurality of methods at or above said class object.
9. The apparatus of
means for storing a stub method in said proxy class object for calling a system object model environment dispatcher for searching methods within said system object model.
10. The apparatus of
creating a method table for said proxy class object having new methods for said dynamic language.
11. The method of
means for storing a method overridden by said dynamic language in said method table.
12. The method of
means for storing class data in said method table of said proxy class object.
14. The method of
searching said first development environment for said class object and a plurality of methods at or above said class object.
15. The method of
storing a stub method in said proxy class object in said dynamic language for calling a first development environment dispatcher for searching methods within said first development environment.
16. The method of
creating a method table for said proxy class object having new methods for said dynamic language.
17. The method of
storing a method overridden by said dynamic language in said method table.
18. The method of
storing class data in said method table of said proxy class object.
|
The present invention relates to data processing systems, and more particularly, to subclassing objects across dynamic language boundaries using a System Object Model (SOM).
After years of debate and discussion, object-oriented programming languages (or OOP) are becoming mainstream programming technologies. The OOP languages offer improved programmer productivity, reusable code and easier maintenance. The IBM System Object Model (SOM) product, which is manufactured by the IBM Corporation, is a language neutral object-oriented object model that can be used to create user toolkits (System Object Model is a trademark of the IBM Corporation). An important requirement for such a user toolkit is the ability to subclass objects included in the toolkit. An object, as used in this invention, has the properties of encapsulation, inheritance, and polymorphism. Encapsulation refers to the hiding of an object's implementation details. Inheritance refers to a technique of specifying the shape and behavior of a class of objects, called a derived class, or a subclass, as incremental differences from another class, called a parent class or superclass. Polymorphism refers to the ability to hide different implementations behind a common interface, simplifying the communications among the objects. The subclassing of objects provides a mechanism to create completely new application objects that can cooperate with the objects in the toolkit. This allows the objects to be used in an application builder that can be offered with the toolkit. Early object-oriented object models allowed subclassing only for static languages such as C/C++. However, recent efforts have concentrated on providing subclassing for dynamic object-oriented languages such as Smalltalk, REXX and Common LISP (CLOS).
One method discloses: a procedure for permitting classes written in a dynamic language to be exported to SOM. The procedure consists of writing a class definition file that describes the interfaces of the dynamic language methods. The class definition file contains all the prototypes for the dynamic language method. Next, a class implementation file is created containing method bodies, which are special stubs that pass control to a dynamic language method dispatcher. A class object is passed as a parameter to the dynamic language method dispatcher which starts method lookup for the class. A SOM compiler processes the class definition file and creates an include file. Instances and send messages are created using the class object. Subclassing is accomplished using the include files generated by the SOM compiler.
Another procedure discloses a dynamic language that creates a SOM proxy object to represent real SOM objects. The proxy object has an instance variable which points to the real SOM object, and is used by the dynamic language to send messages to the SOM objects. The concept relies upon the implementation of a generic method by the dynamic language which allows "unknown" methods, that are called when the object receives a message that is not recognized by the dynamic language. Since SOM messages are foreign to the dynamic language, the "unknown" methods enables redirection of messages to the SOM objects.
Therefore, it is desirable to have a mechanism that provides subclassing of objects in a System Object Model toolkit for an object-oriented dynamic language.
This invention relates to a method and apparatus for subclassing System Object Model (SOM) objects for a dynamic object-oriented language. Subclassing permits a user to change the default behavior of the objects using the dynamic language. A proxy class object is created using the dynamic language that points to the SOM class object. The proxy class object contains a stub method for each of the SOM classes. Activation of the stub method causes the corresponding SOM method to be invoked. Next, a dynamic language subclass is created. This is followed by the creation of a SOM class object using the SOM interface "somCreateDynamicClass", which causes certain SOM methods to be overridden by dynamic language redispatch stubs. The dynamic language causes the "somDispatch" interface to be overridden and replaced with its own dispatch procedures. The new dispatch procedure searches for a method in the dynamic language class object method table first, and if not found, redirects the message to the SOM environment.
This invention provides a method and apparatus for subclassing System Object Model (SOM) class objects for an object-oriented dynamic language. Subclassing SOM objects is preferably practiced in the context of an operating system resident on an IBM PS/2 computer available from the IBM Corporation. A representative hardware environment is depicted in
The OS/2 2.x (OS/2 is a trademark and product manufactured by the IBM Corporation) operating system, includes a language-neutral Object-Oriented programming mechanism called the System Object Model (SOM). A basic SOM data structure is shown in
With reference to
Turning now to
Turning now to
Turning to
Turning now to
Turning to
Turning now to
While the invention has been described with respect to a preferred embodiment thereof, it will be understood by those skilled in the art that various changes in detail may be made therein without departing form the spirit, scope, and teaching of the invention. Accordingly, the herein disclosed invention is to be limited only as specified in the following claims.
Renshaw, David Seager, Conner, Michael Haden, Coskun, Nurcan, Nash, Simon Christopher
Patent | Priority | Assignee | Title |
6598220, | Dec 17 1999 | Dell Products L P | System and method for allowing registerable runtime modification of object behaviors |
7526502, | Sep 10 2004 | Microsoft Technology Licensing, LLC | Dynamic call site binding |
8438577, | Apr 18 2005 | Malikie Innovations Limited | Method and system for extending scripting languages |
Patent | Priority | Assignee | Title |
4635208, | Jan 18 1985 | Hewlett-Packard Company | Computer-aided design of systems |
4791550, | Feb 13 1985 | Rational | Higher order language-directed computer |
4821211, | Nov 19 1987 | International Business Machines Corp. | Method of navigating among program menus using a graphical menu tree |
4821220, | Jul 25 1986 | Tektronix, Inc. | System for animating program operation and displaying time-based relationships |
4853843, | Dec 18 1987 | TEKTRONIX, INC , A CORP OF OREGON | System for merging virtual partitions of a distributed database |
4885717, | Sep 25 1986 | Tektronix, Inc.; TEKTRONIX, INC , 4900 S W GRIFFITH DRIVE, P O BOX 500, BEAVERTON, OR 97077 AN OR CORP | System for graphically representing operation of object-oriented programs |
4953080, | Apr 25 1988 | Hewlett-Packard Company | Object management facility for maintaining data in a computer system |
4989132, | Oct 24 1988 | Eastman Kodak Company | Object-oriented, logic, and database programming tool with garbage collection |
5093914, | Dec 15 1989 | AT&T Bell Laboratories; BELL TELEPHONE LABORATORIES, INCORPORATED, A CORP OF NY; AMERICAN TELEPHONE AND TELEGRAPH COMPANY, A CORP OF NY | Method of controlling the execution of object-oriented programs |
5179703, | Nov 17 1987 | International Business Machines Corporation | Dynamically adaptive environment for computer programs |
5583983, | Nov 17 1994 | OBJECTWARE, INC | Multi-platform object-oriented software development and deployment system |
5640550, | Apr 15 1994 | MICRO FOCUS US , INC | Computer system for generating SQL statements from COBOL code |
Executed on | Assignor | Assignee | Conveyance | Frame | Reel | Doc |
Dec 04 1995 | International Business Machines Corporation | (assignment on the face of the patent) | / |
Date | Maintenance Fee Events |
Sep 14 2005 | M1551: Payment of Maintenance Fee, 4th Year, Large Entity. |
Jan 18 2010 | REM: Maintenance Fee Reminder Mailed. |
Jun 11 2010 | EXP: Patent Expired for Failure to Pay Maintenance Fees. |
Date | Maintenance Schedule |
Jun 11 2005 | 4 years fee payment window open |
Dec 11 2005 | 6 months grace period start (w surcharge) |
Jun 11 2006 | patent expiry (for year 4) |
Jun 11 2008 | 2 years to revive unintentionally abandoned end. (for year 4) |
Jun 11 2009 | 8 years fee payment window open |
Dec 11 2009 | 6 months grace period start (w surcharge) |
Jun 11 2010 | patent expiry (for year 8) |
Jun 11 2012 | 2 years to revive unintentionally abandoned end. (for year 8) |
Jun 11 2013 | 12 years fee payment window open |
Dec 11 2013 | 6 months grace period start (w surcharge) |
Jun 11 2014 | patent expiry (for year 12) |
Jun 11 2016 | 2 years to revive unintentionally abandoned end. (for year 12) |