CN1155694A - Method and apparatus for subclassing system object model classes in dynamic languages - Google Patents

Method and apparatus for subclassing system object model classes in dynamic languages Download PDF

Info

Publication number
CN1155694A
CN1155694A CN 96121509 CN96121509A CN1155694A CN 1155694 A CN1155694 A CN 1155694A CN 96121509 CN96121509 CN 96121509 CN 96121509 A CN96121509 A CN 96121509A CN 1155694 A CN1155694 A CN 1155694A
Authority
CN
China
Prior art keywords
class object
dynamic language
class
som
object model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN 96121509
Other languages
Chinese (zh)
Inventor
迈克尔·黑登·康纳
纳坎·科斯维
西姆森·克里斯托弗·纳什
戴维·西格·伦肖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
International Business Machines Corp
Original Assignee
International Business Machines Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by International Business Machines Corp filed Critical International Business Machines Corp
Priority to CN 96121509 priority Critical patent/CN1155694A/en
Publication of CN1155694A publication Critical patent/CN1155694A/en
Pending legal-status Critical Current

Links

Images

Abstract

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.

Description

Generate the method and apparatus of subclass System Object Model class with dynamic language
The present invention relates to data handling system, more particularly, using system object model (SOM) generates the subclass object through the dynamic language border.
Through after arguing for many years and discussing, object-oriented programming language (OOP) is just becoming the main flow programmatics.The OOP language provides improved programmer's yield-power, and reusable code is safeguarded with being easy to.IBM System Object Model (SOM) product of being produced by IBM Corporation is the OO object model of a language neutral, can be used for generating user instrument (System Object Model System Objeet Model is a trade mark of IBM Corporation).An important requirement to such user instrument is the ability that generates the object that comprises in the subclass tool box.As used herein, an object has encapsulation property, inheritance and polymorphism.Encapsulation property means the hiding of realization details of an object.Inheritance means kind and the behavior of determining an object class.This object class is called derived class or subclass, as from the another kind of difference that increases civilian class or the superclass that is called.Polymorphism means hides different the realization behind a common interface, simplify the ability of communicating by letter between the object.The mechanism of constructing the whole new set of applications object that can cooperate with object in the tool box that provides is provided the subclass of object.This allows object that the application construction device that provides with the tool box is provided.Early stage OO object model only allows for the such static instruction of C/C++ and generates subclass.Yet recent effort concentrates on the ability that generates subclass for providing such as Smalltalk, REXX, the so dynamic object-oriented language of Common LISP (CLOS).
A method discloses a process that class is input to SOM of writing with dynamic language.This process comprises writes a class definition file of describing dynamic language method interface.The class definition file has comprised all prototypes of dynamic language method.Subsequently, generate a class that comprises the method body and realize file, this file promptly is a specific root program of control being passed to dynamic language method scheduler program.Class object is passed to dynamic language method scheduler program as parameter, and scheduler program starts the method for searching class.A SOM compiler processes class definition file also produces an include file.Use class object to generate example and transmission message.Use has been finished the subclass generation by the include file that the SOM compiler produces.
Another open process a kind ofly produce a SOM agent object to represent the dynamic language of actual SOM object.Instance variable that points to actual SOM object of this agent object, dynamic language uses this instance variable to send message to the SOM object.This kind imagination depends on the realization of generic method of the dynamic language of permission " the unknown " method, and the generic method is called when object is received the message that a dynamic language can not discern.Because SOM message is not in the know for dynamic language, " the unknown " method allows message is redirected to the SOM object.
Therefore, need a kind of mechanism to generate for OO dynamic language provides the subclass of class object in the System Object Model tool box.
The present invention relates to be used for generation subclass System Object Model (SOM) object method and the device of dynamic object oriented language.Generating subclass allows the user to use dynamic language to change the default behavior of object.Use dynamic language to produce a proxy class object that points to the SOM class object.The proxy class object comprises the rooter method of each SOM class.The activation of rooter method causes calling of corresponding SOM method.Next step generates a dynamic language subclass.Use SOM interface " somCreateDynamicClass " to generate a SOM class object subsequently, this makes some SOM method be dispatched rooter again by dynamic language again and resets.Dynamic language is reset " somDispatch " interface and is replaced by its scheduling process.New scheduling process is at first searched a method in dynamic language class object method table, if do not find, then message is redirected to the SOM environment.
Fig. 1 is the computing machine/workstation block diagram that can use this invention.
Fig. 2 is the block diagram of IBM System Object Model structure function piece.
Fig. 3 is the process flow diagram flow chart that generates proxy class object and subclass object with dynamic language.
Fig. 4 is the process flow diagram that generates the process of a SOM class object.
Fig. 5 is to use dynamic language to increase the process flow diagram of new method.
Fig. 6 is to use the process flow diagram of dynamic language replacement SOM method.
Fig. 7 generates the process flow diagram of instance variable (class data) with dynamic language.
Fig. 8 is the process flow diagram that generates the class example with dynamic language.
Fig. 9 is the process flow diagram that sends message with dynamic language to class object.
The present invention provides the method and apparatus of a kind of generation subclass System Object Model (SOM) class object for OO dynamic language.Generate subclass SOM object and be more suitable for being applied to residing at the IBM that can obtain from IBM Corporation #Computing machine in the PS/2 operating system environment.Fig. 1 has described a typical hardware environment, has illustrated according to the exemplary hardware configuration of the workstation of relevant invention to have a cpu 10, such as the microprocessor of routine, and by interconnected many other parts of system bus 12.Workstation shown in Figure 1 comprises a random access storage device (RAM) 14, ROM (read-only memory) (ROM) 16, one is used to connect such as the I/O adapter 18 of disk pack 20 such peripheral hardwares to bus, one is used to connect keyboard 24, mouse 26, loudspeaker 28, microphone 32, and/or be used to connect workstation communication adapter 34 and display adapter 36 that is used for display 38 is attached to bus to data processing network such as the such user interface facilities of touch screen (unlisted) to 22, one of the user interface adapter of bus.Workstation in preferred forms on it resident os/2 operation system and be included in as a tool box in form the computer software of this invention.
OS/22.x (OS/2 is a trade mark and the product produced by IBM Corporation) operating system comprises an object-oriented programming mechanism that is called the language neutral of System Object Model (SOM).Fig. 2 has illustrated a basic SOM data structure.A status data structure 210 is used to illustrate that its first full word 220 of a special object comprises the address of the procedure table 240 of this object.Procedure table 240 contains the address of class object data structure 245.Address with the whole bag of tricks of special object 250 and 260.Address 245 sense(-)class object data structures 248.Object belongs to of a sort all objects and comprises the address of pointing to the method process table 240 equally therewith.When occurring in the procedure table 240 of all methods that object is inherited, their procedure address will be arranged at the same offset place of internal memory in ancestors' class.Contain two procedures instruction sequence the calculator memory piece the address 250 and 260 the statement.Position 270 and 280 is arranged in calculator memory and contains the instruction sequence of address, 250 and 260 place ad hoc approach process pointed.The complete description of IBM System Object Model can be found at following document, IBM file AT9-91-072, sequence number 07/805,778, U.S. Patent number 5,421,016, name is called " from a kind of application program of calling design for static method dynamically the system and method for allocating object model ", and layout here as a reference.
Fig. 3 has illustrated that the present invention generates the new subclass generting machanism of the SOM class subclass of " Student " by name with a dynamic object oriented language class of " Graduate " by name.Process generates a dynamic language proxy class object from frame 300 310, points to " Student " SOM class object.Agent object is one, and to be used to receive message and to send a message to one be agency's object, and make replying as practical object and return an object of replying.Shown in frame 320, the proxy class object contains a rooter method of each method in the SOM class.When activating the rooter method shown in frame 340, " somClassDispatch " mechanism of its invoke block 360 is to call corresponding SOM method.Those SOM methods that the rooter method is only searched " Student " class shown in frame 380 or defined on it.Process proceeds to frame 390, for " Graduate " class has generated a dynamic language subclass " Student ".Shown in frame 400, the dynamic language class object has the method table of a tracking with the method new or that reset of dynamic language realization.The dynamic language class object keeps the information of related genera data equally.
Turn to Fig. 4 now, process continues 410, advances to frame 420, has generated the SOM class object of " Graduate " by name by using the SOM interface.SOM interface " somCreateDynamicClass " is used to generate class object " Graduate ".Those skilled in the art understand the generation that can be finished class object " Graduate " by dynamic language automatically.When the SOM interface has generated " Graduate " time-like, all method pointers are dispatched rooter again and are reset except that " somDispatch " and " somClassDispatch " shown in frame 430.The main effect of dispatching rooter shown in frame 440 again is control stream to be redirected to all information via scheduling mechanisms that " SomDispatch " send to this class object be redirected to " somDispatch " interface.At scheduling process replacement " somDispatch " interface of dynamic language shown in the frame 450 with it.Shown in frame 460, new scheduling process is method for searching in dynamic language class object method table at first.If the method realizes that with dynamic language shown in frame 470, it will be cited in the dynamic language environment.Otherwise,, message is redirected to the SOM environment by calling " somClassDispatch " interface shown in the frame 480.
Turn to Fig. 5 now, a process that increases new method with dynamic language has been described.This process proceeds to frame 510 from frame 500, determines whether to increase a new method.Use dynamic language to increase new method at frame 520.Shown in frame 530, new method is added to the dynamic language method table of class object.Can use new method according to frame 540#SOM environment through scheduling resolution mechanism.
Turn to Fig. 6, disclose a process with the dynamic language remapping method.Process proceeds to frame 610 in frame 600 beginnings, and whether detect has the SOM method to reset.If have, shown in frame 620, process allows to add new method to dynamic language method table.After increasing new method, need to determine whether the visit new method at frame 630.If need, need to determine whether skew to differentiate in frame 640 processes.If use skew to differentiate mechanism visit new method at frame 670.Otherwise, check at frame 650 to determine whether to need to want the title resolution.If need, process uses title to differentiate mechanism visit new method.Otherwise, need to determine whether scheduling to differentiate in frame 660 processes.If need, use scheduling to differentiate mechanism visit new method in frame 690 processes.Otherwise, stop in frame 700 processes.Can realize down and can use new method through any resolution mechanism from the SOM environment.
Turn to Fig. 7 now, a process that generates instance variable (class data) has been described.Process begins to proceed to piece 720 from frame 710, checks to determine whether to need to generate the class data.If need, frame 730 processes with pure dynamic language class in the mode of instance variable in the dynamic language environment, generate instance variable.Otherwise, stop in frame 740 processes.
Turn to Fig. 8, a technology that generates the class example has been described.Process generates example " Graduate " in frame 810 beginnings.This can finish under SOM environment or dynamic language environment.Those skilled in the art understand when generating an example in a selected environment, can generate a respective instance automatically in non-selected environments.Get back to Fig. 8,, will produce the pointer of a sensing SOM environment instance of agent shown in frame 840 at frame 840 dynamic language examples if process determines that at frame 820 a dynamic language example is generated.In addition, the dynamic language example will carry the dynamic language object data equally.If generated a SOM example, then a pointed dynamic language instance of agent will be arranged at frame 850#SOM example at frame 830.
Turn to Fig. 9 now, flowchart text send message to " Graduate " class object.Process begins to proceed to frame 910 at frame 900, and determining whether needs to send message to class object " Graduate ".If determine further at frame 920 whether method defines in the method table.If method defines, quote the method in dynamic language side at frame 930 in the method table.Dynamic language sends " somClassDispatch " interface to the form preparation method parameter of a variable parameter table and with it.If do not have the method in the method table, determine whether to need to add the method in frame 940 processes.If, in frame 950 invocation of procedure processes to add the method.Otherwise process finishes at frame 970.
Although the present invention has been described with reference to preferred forms, but those skilled in the art understand and do not deviate from spirit of the present invention, scope here and give advice in detail and can make various variation, therefore, invention disclosed herein only is defined in the content of defined in subsequently claims.

Claims (12)

1. the OO dynamic language of usefulness that realizes in computer system generates the method for subclass System Object Model object, comprises step:
Class object with specific names is provided in the System Object Model environment;
In described System Object Model environment, generate one and have a proxy class object that points to described class object pointer with described dynamic language;
In described System Object Model environment, generate a subclass with specific names of described class object with described dynamic language; And
By calling a scheduler program in the described proxy class object, so that in a method of described System Object Model environment, search described class object.
2. the method for claim 1 is characterized in that the step of calling also comprises:
In described System Object Model environment, search described class object and in described class object or the many methods on it.
3. the method for claim 1 is characterized in that the step that generates a proxy class object also comprises:
Thereby store a rooter method for calling a System Object Model environment scheduler program in described proxy class object, described scheduler program is used to dispatch the method for searching in the described System Object Model.
4. the method for claim 1 is characterized in that the step that generates a proxy class object also comprises:
For described proxy class object with the new method that is used for described dynamic language generates a method table.
5. the method for claim 4 is characterized in that the step that generates a method table also comprises:
Method of being reset by described dynamic language of storage in described method table.
6. the method for claim 4 is characterized in that also comprising in the step that generates a proxy class object:
Storage class data in the described method table of described proxy class object.
7. one is adopted OO dynamic language to generate the device of subclass System Object Model object in data handling system, comprising:
Be used for providing a device with class object of specific names at a System Object Model environment;
Adopt described dynamic language to generate one and have the device that points to the proxy class object of the pointer of class object described in the described System Object Model environment;
Adopt described dynamic language to generate a device that has in the subclass of the create name of class object described in the described System Object Model environment; With
Be used to the device of in a method of described System Object Model environment, searching described class object and from described proxy class object, calling a scheduler program.
8. the device of claim 7 is characterized in that the device that is used to call also comprises:
Be used for searching described class object and at the device of described class object or the many methods on it at described System Object Model environment.
9. the device of claim 7 is characterized in that generating the device of a proxy class object, also comprises:
Call the device of a System Object Model environment scheduler program in a rooter method of described proxy class object stored thereby be used to, described scheduler program is used to dispatch the method for searching in the described System Object Model.
10. the device of claim 7 is characterized in that the device that generates a proxy class object also comprises:
Be described device with the method table of proxy class object generation that is used for described new method of dynamically appraising through discussion.
11. the method for claim 10, the device that it is characterized in that being used to generating a method table also comprises:
The device that is used for the method reset by described dynamic language one of described method table storage.
12. the method for claim 10, the device that it is characterized in that being used to generating a proxy class object also comprises:
Be used for device in the described method table storage class data of described proxy class object.
CN 96121509 1995-12-04 1996-12-03 Method and apparatus for subclassing system object model classes in dynamic languages Pending CN1155694A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 96121509 CN1155694A (en) 1995-12-04 1996-12-03 Method and apparatus for subclassing system object model classes in dynamic languages

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US566,618 1995-12-04
CN 96121509 CN1155694A (en) 1995-12-04 1996-12-03 Method and apparatus for subclassing system object model classes in dynamic languages

Publications (1)

Publication Number Publication Date
CN1155694A true CN1155694A (en) 1997-07-30

Family

ID=5126928

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 96121509 Pending CN1155694A (en) 1995-12-04 1996-12-03 Method and apparatus for subclassing system object model classes in dynamic languages

Country Status (1)

Country Link
CN (1) CN1155694A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100375542C (en) * 2001-07-20 2008-03-12 中兴通讯股份有限公司 Message dispatching method in communication equipment software subsystem
CN101819536A (en) * 2010-05-14 2010-09-01 西安交通大学 Particle-oriented program constructing method
CN105723341A (en) * 2013-06-06 2016-06-29 微软技术许可有限责任公司 Interface for representing bindings between objects in a web browser's layout engine memory space and objects in a scripting engine memory space
US10248415B2 (en) 2011-05-19 2019-04-02 Microsoft Technology Licensing, Llc Dynamic code generation and memory management for component object model data constructs
WO2024074036A1 (en) * 2022-10-04 2024-04-11 International Business Machines Corporation Unknown object sub-class identification

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100375542C (en) * 2001-07-20 2008-03-12 中兴通讯股份有限公司 Message dispatching method in communication equipment software subsystem
CN101819536A (en) * 2010-05-14 2010-09-01 西安交通大学 Particle-oriented program constructing method
CN101819536B (en) * 2010-05-14 2012-11-28 西安交通大学 Particle-oriented program constructing method
US10248415B2 (en) 2011-05-19 2019-04-02 Microsoft Technology Licensing, Llc Dynamic code generation and memory management for component object model data constructs
CN105723341A (en) * 2013-06-06 2016-06-29 微软技术许可有限责任公司 Interface for representing bindings between objects in a web browser's layout engine memory space and objects in a scripting engine memory space
US10282238B2 (en) 2013-06-06 2019-05-07 Microsoft Technology Licensing, Llc Memory model for a layout engine and scripting engine
US10353751B2 (en) 2013-06-06 2019-07-16 Microsoft Technology Licensing, Llc Memory model for a layout engine and scripting engine
CN105723341B (en) * 2013-06-06 2019-12-03 微软技术许可有限责任公司 Realization method and system for layout engine and the memory model of script engine
WO2024074036A1 (en) * 2022-10-04 2024-04-11 International Business Machines Corporation Unknown object sub-class identification

Similar Documents

Publication Publication Date Title
EP0777178B1 (en) Data processing system
US5911068A (en) Container independent control architecture
US7017118B1 (en) Method and apparatus for reordering data items
Calvary et al. A unifying reference framework for multi-target user interfaces
US6275227B1 (en) Computer system and method for controlling the same utilizing a user interface control integrated with multiple sets of instructional material therefor
US6469714B2 (en) Infocenter user interface for applets and components
US6053948A (en) Method and apparatus using a memory model
US7725904B2 (en) Method and system for accessing externally-defined objects from an array-based mathematical computing environment
US20020099868A1 (en) Method and system for associating parameters of containers and contained objects
JP2012084165A (en) Program for causing computer to generate user interface
CA2479931A1 (en) System, method and computer program product for generating a shader program
EP0988589A1 (en) Sound authoring system and method for silent application
US5991538A (en) System for generating and using programs in an object-oriented environment with a message dispatch architecture
JPH09500744A (en) Place object system
Wheeler Atkinson et al. Development of a multiple heuristics evaluation table (MHET) to support software development and usability analysis
De Carlo et al. Advanced visualization and interaction in GLSP-based web modeling: realizing semantic zoom and off-screen elements
CN111580798A (en) Dynamic link library implementation method, system, computer equipment and storage medium
Crease et al. A toolkit of mechanism and context independent widgets
JP2008501195A (en) A system that enforces object-oriented context rules
CN1155694A (en) Method and apparatus for subclassing system object model classes in dynamic languages
Calvary et al. Embedding plasticity in the development process of interactive systems
Salleh et al. Computing for numerical methods using visual C++
EP1130510A2 (en) Method and system for remote control and interaction with a run time environment component
West et al. A context inference and multi-modal approach to mobile information access
Kuljis User interfaces and discrete event simulation models

Legal Events

Date Code Title Description
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C06 Publication
PB01 Publication
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication