Abstract:
An object-oriented data base management system connected to a plurality of data bases includes a class definition unit, a static inheritance processing unit included within the class definition unit, a message processing unit, a dynamic inheritance processing unit included within the message processing unit, and an object management unit. The object-oriented data base management system is of the type that defines the inheritance relationship between a plurality of classes and an arbitrary class and the inheritance priority order, the class being a basic unit of programming, and executes the data processing by solving the inheritance relationship between classes in accordance with the priority order. There is prepared, for each class, updatable inheritance solution status information which the static inheritance processing unit causes to be stored in a table. The inheritance solution status information includes status information and time information. The status information is representative of whether or not inheritance between the class and the superclasses can be completely solved, and the time information is representative of a time when the status is established. When a message processing is requested for an object of a class, the dynamic inheritance processing unit searches the method designated by the message while referring to the inheritance solution status information regarding the class and the superclass stored in the table.

Description:
BACKGROUND OF THE INVENTION 
     The present invention relates to an object-oriented data processing technique, and more particularly to an inheritance solution processing method and apparatus for solving inheritance relationships between classes in an object-oriented data processing system. 
     One of the advantages of an object-oriented data processing system is a concept of inheritance between classes each constituting a basic programming unit. For example, it is possible for an &#34;automobile class&#34; or &#34;ship class&#34; to inherit, from a &#34;vehicle class&#34;, general vehicle attributes (such as manufacturer name, weight, and etc.) and a function (such as calculation of pressure). The term &#34;inheritance&#34; means that a lower class inherits or merges the attribute and function of an upper class. The &#34;vehicle class&#34; having a higher hierarchic concept is called a &#34;superlcass&#34; of the &#34;automobile class&#34; or &#34;ship class&#34;, whereas the &#34;automobile class&#34; or &#34;ship class&#34; having a lower hierarchic concept is called a &#34;subclass&#34; of the &#34;vehicle class&#34;. In an object-oriented system, such as inheritance function of a class encourages modular design and reuse of programs. 
     In most of object-oriented systems, a class can have one or more superclasses, and can inherit attributes from them. Such a function is called a multiple inheritance. With multiple inheritance, the following collisions occur between names of attributes and functions to be inherited: 
     (1) a collision between a class and a superclass, and 
     (2) a collision between superclasses of a class. 
     Such a collision is solved in accordance with particular rules provided to each system. For example, for a collision between a class and a superclass, a definition in the class is preferentially used. For a collision between superclasses of a class, a definition in the first superclass within the superclass list is preferentially selected. 
     Encapsulation and Inheritance in Object-Oriented Programming Languages&#34; by Alan Snyder, 1986 ACM 0-89791-204-7/86/0900-0038 discloses a method for resolving the name conflict such as &#34;Graph-Oriented Solutions&#34;, &#34;Linear Solutions&#34; and &#34;Tree Solutions&#34;. With these solutions, if a conflict occurs, it is determined which class is adopted or not adopted and which criterion is used for such determination. 
     An operation of an object-oriented system corresponds to processing a message to be sent to an object. A message generally designates a method name representative of a function (hereinafter also called a method) to be applied to an object (hereinafter also called a receiver, meaning a receptor of a message) and a parameter for the method. In an object-oriented system having an inheritance function, in order to process a message, it is necessary to locate a method designated by the message from a class to which the receiver belongs or from its superclass. 
     In order to determine the time when a method is located, there is a dynamic inheritance processing scheme by which a search up to a superclass is executed while a message is processed, and a static inheritance processing scheme by which a class merges the attribute and function of its superclass when the class is compiled. According to the dynamic inheritance processing scheme, it is sufficient if a necessary superclass is defined at the time when a message is processed. Therefore, application development has a high flexibility. However, there is a large overhead of class search at the time of message processing. According to the static inheritance processing scheme, it is not necessary to search superclasses at the time of message processing, so that the message can be processed at a high speed. However, it is required that all necessary superclasses must be defined at the time of compiling, resulting in less flexibility. 
     One method of solving such problems is disclosed, for example, in Japanese Patent Laid-open Publication JP-A 1-240936 &#34;Inheritance Solution Method&#34;. According to this method, the inheritance of a designated class is solved in advance at the time of compiling, and at the time of processing a message, the inheritance of a class not solved as yet is solved at that time. According to the prior art method, while preserving a flexibility of application development, an overhead of class search for inheritance solution at the time of processing a message can be made as small as possible at any stage of application development. 
     The term &#34;inheritance solution&#34; used in the description of the prior art method means that a class on the subclass side merges the definition of a superclass into the internal form of the class. 
     An object-oriented system has been expected to be applied to the technical field dealing with complex data, typically a CAD/CAM, CASE, and the like. The above-described multiple inheritance function is effective for realizing a model of complicate data presently used in the art. 
     In realizing the inheritance function, it becomes necessary to provide a flexibility that the function obtained by inheritance is growing as application development progresses, as pointed out by the prior art method. 
     A basic unit constituting an object-oriented system is a class. In actual application development, it is useful that the executable range of a function obtained by inheritance be as wide as possible to the extent sufficient for the definition contents at the intermediate stage of application development, because the debugging work of a class can be made through local verification. It is therefore necessary to efficiently execute both a partial inheritance processing in accordance with the definition contents at a certain stage of application development and an inheritance re-processing in accordance with the definition of a new class or the updated definition of an old class. 
     At the intermediate stage of application development, inheritance from a superclass still not defined cannot be allowed. Even if a superclass has been defined. Inheritance may not be allowed depending upon a multiple inheritance collision solution rule specific to a system. For example, if a superclass having a higher priority order is not still defined, the definition contents to be inherited from a superclass having a lower priority order cannot be determined. The reason for this is as follows. Even if the definition contents are inherited from the superclass having a lower priority order and a debugging work and the like are carried out, these operations may be made invalid depending upon the definition contents of the superclass having a higher priority order. 
     The above problems are related to the contents of inheritance regarding a permission/prohibition of inheritance between a class and its superclass, and are independent from the timing of inheritance processing. The above-described prior art method does not concern this issue. 
     SUMMARY OF THE INVENTION 
     It is an object of the present invention to provide a class inheritance solution processing method and apparatus capable of obtaining a flexible application development environment, by which the inheritance status representative of whether inheritance of all superclasses of a class can be completely processed or not, and the time when the status is established, are stored and managed for each class, so that both a partial inheritance processing and an inheritance re-processing to be executed as the development progresses can be reliably and efficiently performed in accordance with the priority order of superclasses. 
     In order to achieve the above object, according to one aspect of the present invention, there is provided an object-oriented data processing and programming system which defines the inheritance relationship between a plurality of classes and an arbitrary class and the inheritance priority order of the plurality of classes, and executes the data processing by solving the inheritance relationship of the class in accordance with the priority order. The system is provided with a static inheritance processing unit, and a dynamic inheritance processing unit. The static inheritance processing unit causes a storage means to store inheritance solution status information for each class, the inheritance solution status information including status information representative of whether or not inheritance of all superclasses of an arbitrary class can be processed completely, and a status established time representative of the time when the status is established. The dynamic inheritance processing unit operates such that if a message processing of an arbitrary class is requested, it refers to the inheritance solution status information of the arbitrary class and the associated superclasses stored in the storage means, and searches a method designated by the message. 
     According to the present invention, the static inheritance processing unit judges whether or not inheritance of all superclasses of each class can be processed completely, in accordance with the priority order of superclasses, and generates and updates the inheritance solution status information including the status information representative of the judgment results, and the status established time. For example, in updating the inheritance solution status information of a class, a superclass having a higher priority order is sequentially selected as a target superclass. The status established time of the class is compared with that of the target superclass. If the former time is earlier than the latter time, the inheritance processing of the target superclass is recurrently executed. After the inheritance processing of the target superclass, the definition contents of the target superclass are merged into the class. Alternatively, if the former time is later than the latter time, it means that the inheritance solution of the superclass has not been updated. Therefore, the recurrent inheritance processing of the target superclass and merge of the definition contents thereof are not carried out. After the above processes, the status of the target superclass is checked. If the status is the incomplete solution status, inheritance of the superclass having a lower priority order than that of the target superclass is omitted to terminate the inheritance processing of the class. If the status of the target superclass is the complete solution status, a superclass having the next highest priority order is selected to repeat the above processes. 
     After the above-described processing of a class is executed, a similar inheritance processing is executed for subclasses for that class, thereby realizing a static inheritance processing for all classes associated with the class in interest. In this case, a list or table for storing names of subclasses for each class may be used for the management of subclasses, thereby efficiently deriving relational subclasses. 
     If a message processing is requested for an object of a class, a method designated by the message is searched generally from the class now in concern. Only if the method is not present within the class, a superclass is searched. In this case, the dynamic inheritance processing unit sequentially selects as a target superclass a superclass having a higher priority order. If the status of the target superclass is the incomplete solution status, a search is not carried out up to a superclass having a lower priority order than that of the target superclass. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a flow chart showing an inheritance solution processing according to an embodiment of the present invention. 
     FIG. 2 shows an example of the structure of a data base system embodying the present invention. 
     FIG. 3 shows an example of the functional structure of a data base management system (DBMS) according to the present invention. 
     FIG. 4A shows an example of a class definition source form. 
     FIG. 4B shows an example of the internal form of a class. 
     FIG. 5 is a diagram showing the contents of inheritance solution status information used with the present invention. 
     FIGS. 6A to 6C are diagrams showing particular examples of classes and inheritance solution status information, used for explaining the concept of an inheritance solution processing method of the present invention. 
     FIG. 7 is a flow chart showing the processing of searching a method. 
     FIG. 8 is a flow chart showing a dynamic inheritance solution processing of the present invention. 
     FIG. 9 is a flow chart showing an extended static inheritance processing of the present invention. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     The structure and operation of an embodiment of the present invention will be described with reference to the accompanying drawings. 
     FIG. 2 shows an example of the configuration of a data base system according to the present invention. In FIG. 2, reference numerals 20-1 to 20-n, and 20-m represent a data base, 30-1 to 30-n represent a workstation, 31 represents an object server, 300-1 to 300-n, and 300-m represent an object-oriented data base management system (DBMS). In this embodiment, a plurality of workstations 30-1 to 30-n are connected to a network 10. Object information is transferred between workstations via the object server 31. The workstations 30-1 to 30-n and the object server have individual object-oriented data base management systems 300-1 to 300-n, and 300-m, respectively. 
     FIG. 3 is a functional block diagram showing an embodiment of an object-oriented data base management system 300 according to the present invention. The object-oriented data base management system 300 is constructed of a message processing unit 302 having a dynamic inheritance processing unit 309 for executing a method of an object while dynamically executing an inheritance processing, a class definition unit 303 for defining a class, and an object management unit 305 for supervising the storage of an object. The class definition unit 303 analyzes a class definition described in the source form and generates a class object of a predetermined form. If there is a superclass in the class definition, a static inheritance processing unit 304 executes a static inheritance processing in accordance with the method specified by the present invention. The object management unit 305 includes an object area management unit 306 for supervising objects stored in a main storage 310, and a data base management unit 307 for supervising objects stored in a supplementary storage. 
     Object data bases 201 to 20n are connected to and controlled by the data base management unit 307. 
     FIG. 4A shows an example of a class definition form. As shown in FIG. 4A, each class definition 40 is constructed of a &lt;class name&gt; 41 representative of a name of the class, a &lt;superclass name&gt; 42 representative of names of superclasses to be inherited, an &lt;instance variable name&gt; 43A and &lt;instance variable definition&gt; 43B for defining an instance variable of an instance belonging to the class, and a &lt;method name&gt; 44A and &lt;method definition&gt; 44B representative of a method providing a procedure belonging to the class. 
     FIG. 4B shows an internal form of a class defined by the class definition unit 303 while referring to the class definition described in a source form shown in FIG. 4A. 
     A class stores the number of superclasses, and pointers to respective superclasses. Pointers to superclasses are disposed in the priority order of each superclass. 
     The class further stores an instance variable name and its definition information, and a method name and its object code, respectively in a predetermined form. In this case, two approaches can be considered. Instance variables and methods to be inherited from a superclass are all stored in the class, or a part or whole of instance variables and methods to be inherited is not stored in the class but referred to the superclass at the time when they are necessary or inherited. According to the former approach, instance variables and methods necessary for a class can be obtained by searching only the class in interest, thereby speeding up information processing. However, information to be inherited is stored in duplicate, resulting in a poor memory efficiency. According to the latter approach, although there is no duplicated information, necessary information cannot be obtained until the target superclass is searched. 
     According to the present invention, it is assumed that information to be inherited is partially stored or not stored in a class. Namely, in accordance with the internal rule, the class definition unit 303 operates to output or not output definitions to be inherited from a superclass to the internal form of the class. 
     FIG. 5 shows the contents of a class inheritance solution status information table. In this table 50, a status 52 and a status established time 53 are stored for each class (class name) 51. The types and meanings of the status are as follows. 
     (i) Complete Solution Status: C 
     A status wherein there is no superclass designated in the class definition, or a status wherein all superclasses designated in the class definition are in a completely solved state after subjected to the static inheritance processing. 
     (ii) Incomplete Solution Status: NC 
     A status wherein among superclasses designated in the class definition, there is a superclass whose static inheritance processing has not been executed as yet, or a status wherein a static inheritance processing of a superclass under an incompletely solved state was executed. 
     The status established time 53 is a time when the status 52 is established in accordance with the execution results of a static inheritance processing. 
     Next, the concepts of the inheritance solution processing method according to the present invention will be described with reference to FIGS. 6A to 6C. In order to simplify the description, the description is directed to the case wherein classes (c11 to c33) have the definitions 40-1 to 40-3 as shown in FIG. 6A and a static inheritance status information table 50 as shown in FIG. 6B, and a new class (cNew) 40-4 shown in FIG. 6C is newly defined. 
     Referring to FIG. 6B, the status of the classes c11, c33, and c99 is the complete solution status C. The class c22 has superclasses c99 and c88 to be inherited, as seen from the definition 40-2 shown in FIG. 6A. The status 52 of the class c22 is the incomplete solution status NC as indicated in the table 50, because the inheritance of the superclass c99 having the complete solution status has been already solved but the inheritance of the other superclass c88 still having no class definition has not been solved as yet. The particular definition contents of the superclass c99 are omitted for the simplicity of description. 
     As shown in FIG. 6C, the class cNew has as superclasses the classes c11, c22, and c33 the priority order of which is the order as recited. In this embodiment, the class c11 is first selected as a target of static inheritance processing. Since the status of the class c11 is the complete solution status C, the inheritance solution processing is executed with respect to the class c11. Since the next superclass c22 has the incomplete solution status NC, this superclass c22 is subjected to the static inheritance processing to make it have the complete solution status. The class c22 has as superclasses the classes c99 and c88. Since the status of the class c99 is the complete solution status C, the status established times Tc22 and Tc99 are compared. If Tc22 is later than Tc99, i.e., if Tc22 is a later time, it is judged that the inheritance between c99 and c22 has been solved already. If not, for example, if the class c99 was updated after the static inheritance processing of the class c22 was made, it is necessary to again execute the static inheritance processing between the classes c99 and c22. Since the class c88 is not still defined, the static inheritance processing for the classes c88 and c22 is impossible at this time. Therefore, the static inheritance processing for the class c22 is terminated, and the status 52 (incomplete solution status) and the status established time 53 (Tc22) of the class c22 are updated on the table 50. 
     Returning back to the processes of defining the new class cNew, the static inheritance processing between the superclass c22 and new class cNew is executed. In this example, since the static inheritance processing of the superclass c22 under the incomplete solution status was made, the static inheritance processing of the superclass c33 at the next priority order will not provide an establishment of definitions to be inherited from the superclass c33. Accordingly, the static inheritance processing of the superclass c33 is omitted, and the static inheritance processing of the new class cNew is terminated while adding the status (incomplete solution status) and status established time (TcNew) of the class cNew to the static inheritance status information table 50. 
     FIG. 1 is a flow chart showing the procedure of the above-described static inheritance processing. 
     In FIG. 1, a term &#34;CLS&#34; represents a target class to be subject to the inheritance solution processing. &#34;SPR&#34; represents a superclass of a CLS. &#34;SPR(i)&#34; represents a superclass having the priority order i. &#34;N&#34; represents the number of superclasses. &#34;S SPR (i) &#34; represents the status of a superclass SPR(i). &#34;S CLS  &#34; represents the status of a CLS. &#34;S BUF  &#34; represents a variable for temporarily storing a status. &#34;T SPR (i) &#34; represents a status established time of a superclass SPR(i). &#34;T CLS  &#34; represents a status established time of a CLS. 
     First, an inheritance flag is turned OFF (step 100). The number N of superclasses of a CLS is checked. If there is no superclass (N=0), the status and status established time of the CLS are set and thereafter the processing is terminated (step 102, steps 115 to 119). 
     If there is any superclass (N&gt;0), &#34;1&#34; is set as the priority order parameter i so that the static inheritance processing is executed from the superclass having the highest priority order (step 103). Next, it is checked if there is an entry of the superclass SPR(i) in the static inheritance status information table 50 (step 104). If there is no entry, the status and the status established time of the CLS are set and thereafter the processing is terminated (steps 105, steps 115 to 119). 
     If there is an entry in the table 50, the status established time of the superclass SPR(i) is compared with that of the CLS (step 106). If the status established time of the superclass SPR(i) is later than that of the CLS, the inheritance solution processing of the superclass SPR(i) is recursively executed (step 107) to inherit the definition contents of the superclass (step 108) and turn ON the inheritance flag (step 109). Alternatively, if the status established time of the superclass SPR(i) is earlier than that of the CLS, the re-solution processing (steps 107 to 109) of the superclass is not executed. Next, the status of the superclass SPR(i) is checked (step 110). If the status of the superclass is not the complete solution status, the status and status established time of the CLS are set in the inheritance solution status information table 50 (step 105, steps 115 to 119), and thereafter the processing is terminated. 
     If the status of the superclass SPR(i) is the complete solution status, the priority order of the superclass is first checked (step 112). If there is a superclass having a lower priority order (i&lt;N), the priority order parameter i is renewed to execute the processing for the next superclass (step 114) and return back to step 104. If there is no superclass having a lower priority order, the status and status established time of the CLS are set (step 102, steps 115 to 119), and thereafter the processing is terminated. 
     In setting the status and status established time, if the CLS has not its entry in the inheritance solution status information table 50, an entry of the CLS is generated (step 116) to thereafter set T CLS  and S CLS  (steps 118 and 119). If there is an entry of the CLS, the inheritance flag is checked (step 117). If the flag is ON, T CLS  is updated (step 118) and S CLS  is set (step 119). If the inheritance flag is OFF, T CLS  is not updated but only S CLS  is set (step 119). 
     The above-described static inheritance processing does not depend on the solution timings. If a static inheritance processing for a class with new definition or modified definition is executed prior to issuing a message, an inheritance solution can be carried out statistically. 
     FIG. 7 shows the processing of searching a method by the message processing unit 302 under the condition that inheritance has been solved in the above manner. 
     A message to be processed by the message processing unit 302 is assumed that it is constructed of a selector indicating a method to be activated and a receiver meaning a receptor for the message. In FIG. 7, &#34;CLS&#34; represents a class to which the receiver belongs, and &#34;SPR(i)&#34; represents a superclass of a CLS having the priority order i. 
     The message processing unit 302 shown in FIG. 2 searches a method designated by the selector from a CLS (step 701). If there is the method, a pointer to the method definition information is returned, and thereafter the processing is terminated (step 709). If the method is not present within the CLS at step 701, the method is sequentially searched from superclasses of the CLS in the priority order (steps 702 to 707). The steps 702 to 707 are executed by the dynamic inheritance processing unit 309 in the message processing unit 302. If there is the method at step 706, a pointer to the method definition information is returned, and thereafter the processing is terminated (step 709). If the method is not present at step 706 and the status of the superclass is not the complete solution status at step 707, then the superclasses having the priority order (i+1) or lower are not searched and a statement that the method is not present is returned, and thereafter the processing is terminated (step 708). 
     Searching a method designated by the selector from class A means to judge whether or not a method having a name designated by the selector is present within the method definition information of the internal form of class A. 
     In searching the method from a superclass SPR(i) (step 706), the method search processing shown in FIG. 7 is recurrently carried out with respect to the SPR(i) and its superclass. 
     The dynamic inheritance solution according to the present invention will be described next. With the dynamic inheritance solution of the present invention, inheritance solution is carried out if necessary while searching a message. 
     FIG. 8 is a flow chart showing the method search processing using the dynamic inheritance solution. In FIG. 8, &#34;CLS&#34; represents the class to which the receiver of a message belongs. 
     The message processing unit 302 shown in FIG. 2 first searches a method designated by the selector from a CLS (step 801). In accordance with the execution results at step 801, it is judged if the method is present or not (step 802). If the method is present, a pointer to the method definition information is returned, and thereafter the processing is terminated (step 807). If the method is not present in the CLS, the class definition unit 303 is caused to execute the static inheritance processing of the CLS (step 803). After the static inheritance processing, the method is again searched from the CLS. The search results are judged at step 805. If the method is present, a pointer to the method definition information is returned, and thereafter the processing is terminated (step 807). If the method is not present, a statement that the designated method is not present is returned, and the processing is terminated (step 806). 
     In the above manner, the message processing unit 302 and class definition unit 303 operate together to execute the dynamic inheritance solution processing. 
     The static inheritance re-processing of a superclass SPR(i) caused by the static inheritance processing of a class CLS has been described with reference to FIG. 1. In order to solve all inheritances which can be solved statistically, it becomes necessary to adopt an extended processing by which after the processing shown in FIG. 1, the static inheritance reprocessing of subclasses of a CLS is executed. 
     Such extended static inheritance processing will be described with reference to FIG. 9. 
     In FIG. 9, &#34;SUB(j)&#34; represents a subclass of a CLS used in FIG. 1, and &#34;M&#34; represents the number of subclasses. After the completion of the static inheritance processing of a CLS described with FIG. 1 (step 900), the number of subclasses of the CLS is checked (step 901). If there is no subclass, the processing is terminated. If there is a subclass, the extended static inheritance processing is carried out with respect to the subclass (step 903). After the extended static inheritance processing is carried out for all subclasses (steps 902 to 905), the processing is terminated. In order to efficiently execute the extended static inheritance processing, a list of subclasses may be provided to each class for supervising them. 
     As described so far, according to the present invention, partial inheritance solution can be performed efficiently using the definition contents at the intermediate stage of application development, while considering the priority order of superclasses. Furthermore, the static inheritance re-processing can be performed reliably and efficiently with respect to only necessary classes already defined.