Quick viewing(Text Mode)

Uillted States Patent [19] [11] Patent Number: 5,379,432 Orton Et Al

Uillted States Patent [19] [11] Patent Number: 5,379,432 Orton Et Al

. USOO5379432A UIllted States Patent [19] [11] Patent Number: 5,379,432 Orton et al. [45] Date of Patent: Jan. 3, 1995

[54] OBJECT-ORIENTED INTERFACE FOR A 5,339,422 8/1994 Brender et al...... 395/700 PROCEDURAL 5,341,478 8/1994 Travis, Jr. et a1...... 395/200 [75] Inventors: Debra L. Orton, San Jose; Eugenie L. OTHER PUBLICATIONS Boltmlr Sunnyvale; Daniel Guedes, Paulo, “Objet-Oriented Interfaces in the chermlioff’ P810 Alto; DaYld B‘ 3.0 Multi-server System”, IEEE 1991. Goldsmlth’ Los Gatos; chnstoPher P‘ Rashid, Richard, “Machi A Foundation For Open Sys . Mwlle's L°S Ah“, 9“ °f Cahf- terns”, Carnegie Mellon University, IEEE 1989. [73] Assignee: , Inc., Cupertino, Calif. Mary Jo Foley, “Taligent, IBM draw closer”, PC Week, Feb. 21, 1994 vol. 11, No. 7 p. 8. [21] Appl‘ No‘: 94’675 Franz, Michael, “Emulating an Operating System on [22] Filed: Jul. 19, 1993 Top of Another”, 1993 by John Wiley & Sons, Ltd. [51] Int. Cl.6 ...... G06F 9/40 Primary Examiner-Kevin A. Kriess [52] US. Cl...... 395/700; 364/280; Assistant Examiner—Matthew M. Payne 364/286; 364/ 976; 364/977.2; 395/500 Attorney, Agent, or Firm—Keith Stephens [58] Field of Search ...... 395/700 [57] ABSTRACT [56] References cued An apparatus for enabling an object-oriented applica U.S. PATENT DOCUMENTS tion to access in an object-oriented manner a procedural 4 456 954 M19“ Bunions) m et a1. " 364/200 operating system having a native procedural interface is 415301052 7/1985 King et a1...... 364/200 dlsclosed- The apparatus Includes a Computer and a 4,821,220 4/1989 Duisberg ...... 364/578 memory component In the computer A code is 4,885,717 12/1989 Beck et a1...... 364/900 stored in the memory component. The code library 4,891,630 1/1990 Friedman et a1. .. 340/706 includes computer program logic implementing an ob 4,953,030 8/1990 Dysalft e! 81------364/200 ject-oriented class library. The object-oriented class 5041992 8/1991 cunmngham et a1‘ ' 364/518 library comprises related object-oriented classes for $1211: ‘1211' """"" " enabling the application to access in an object-oriented 5:075:848 12/1992 Lai et 211. 2.1.5.1‘. 595/425 manner sfirvices Provided by the °Perating System The 5,093,914 3/1992 Cop?en et a1_ __ 395/700 object-oriented classes include methods for accessing 5,119,475 6/ 1992 Smith et al...... 395/ 156 the operating system services using procedural function 5,125,091 6/1992 Staas, Jr. et al. 395/650 calls compatible with the native procedural interface of 5,133,075 7/ 1992 RlSCh ...... 395/800 the operating system_ The computer processes object 5r136r705 8/1992 stubbs et a1‘ 395/575 oriented statements contained in the application and 5’151'987 9/1992 Abfaham et a1‘ 222/ de?ned by the class library by executing methods from 2:151:31 1211333 2233;681:1111: 3955700 rhs slsss lrbrsry corresponding rs rhs objssr-srrsrrsd 5,280,610 1/1994 Travis, Jr. et al. . 395/600 Statements 5,287,507 2/1994 Hamilton et al. 395/650 5,293,385 3/ 1994 Hary ...... 371/19 4 Claims, 17 Drawing Sheets

START F 204

V LOCATE IN PROGRAM OBJECT-O 12 ENTED STATEMENT ACCESSING M 206 OPERATING SYSTEM

ll THANSLATE OBJECT ORIENTED STATEMENT TO PROCEDURAL FUNCTION CALL COMPATIBLE WITH v208 PROCED URAL INTERFACE 0F OPERATING SYSTEM

ll B

212

US. Patent Jan. 3, 1995 Sheet 2 of 17 5,379,432

202

204

LOCATE IN PROGRAM OBJECT-ORIENTED STATEMENT ACCESSING 206 OPERATING SYSTEM

TRANSLATE OBJECT ORIENTED STATEMENT TO PROCEDURAL FUNCTION CALL COMPATIBLE WITH 208 PROCEDURAL INTERFACE OF OPERATING SYSTEM

EXECUTE PROCEDURAL FUNCTION CALL 210

Figure 2 US. Patent Jan. s, 1995 Sheet 3 0f 17 5,379,432

3K @~

METHOD CODE IN TASK ADDRESS SPACE?

LIBRARY SERVER FIND LIBRARY KNOWN? SERVER

ACCESS LIBRARY SERVER AND COPY METHOD CODE FROM CODE LIBRARY TO TASK ADDRESS SPACE

EXECUTE METHOD CODE

Figure 3 US. Patent Jan. s, 1995 Sheet 4 0f 17 5,379,432

CODE CLASSES I 494 m LIBRARY 1 1O

TASK CLASSES I 406

VIRTUAL MEMORY CLASSES I ,408

IPC CLASSES I‘ ,410 CLASS '\/ LIBRARY 402 SYNCHRONIZATION CLASSES|\,412 SCHEDULING CLASSES I 414

FAULT CLASSES I 416

MACHINE CLASSES I 418

SECURITY CLASSES I 420

Figure 4

US. Patent »‘ Jan. s, 1995 Sheet 7 of 17 5,379,432

2:9".h mmmmwm?omimob vi. Emgwiczcoh

Non US. Patent Jan. s, 1995 Sheet 8 of 17 5,379,432

959".m 8226:Sw 59.2 mom vow?mmotawboémsc. boEmEmEdOSOF coEwoQwi EmmSSQcoEmE... mom

US. Patent Jan. 3, 1995 Sheet 10 of 17 5,379,432

coEucoOhoscoik

moo?coop :0’N2:0:: 22:2“ \.\ \\ 292E802 AEEwHSEoSC.xuodouucog.

woo?1/

mooF US. Patent Jan. 3, 1995 Sheet 11 of 17 5,379,432

3.:

oicmInmmEt.E:_. ségowumezt. 2.6m2 0P: mo: mo: \\K8: US. Patent Jan. 3, 1995 Sheet 12 of 17 5,379,432

1 202 TFaultDesignation

( TI'askHandle )

1 206 Tl'hreadHandle '1 1210 1 208 FaultAssociation

( TPortSendHightHandle ’

1212 1212 TFaultTypeSet

( TFaultType ) EFaultMessageType

121 6 1218

1 220 \ 1222 TFaultType 1230

1 224 TMCsaoxoFault-rype - etc. for all possible 68K faults ( TMC68OXOAddressFault ) ( mcsaoxoBadAcoessFault ’

1226 1228 Figure 12

US. Patent Jan. 3, 1995 Sheet 14 of 17 5,379,432

k2=28comm85:26?c.Sun9:22m9: m5325 223m 23E3 v83/‘@8956”; / ?mommmognmmh mow? US. Patent Jan. s, 1995 Sheet 15 of 17 5,379,432

82952m2. shows.29939 222350.“. VEEPA$58885 V82).‘#58885 BSwDnEOXQQQOE 3EVA2230805;mosmm?smoxowwog mmEmExoEwoXommOSC.:3w gmuwummhct.

momP comp amesmvagmoxommozh momF US. Patent Jan. a, 1995 Sheet 16 of 17 5,379,432

25E2 065163829?$9wizmIummEC. 5?osucwzxwmt.sucm?uwozuomgzih c

.Pc 0 \c0651.85. Na: cmow? F

c

momF mooF US. Patent Jan. 3, 1995 Sheet 17 of 17 5,379,432

EaEaomam:2;m‘III HHOAAJ$08.258:m8: ‘J3:AcgaememaéHU$9 ‘wt63u.vf3.“A “ 2.5m2

3263x 3?_onm_x 5,379,432 1 2 A second “fringe bene?t” of good encapsulation in OBJECT-ORIENTED INTERFACE FOR A object-oriented design and programming is that the PROCEDURAL OPERATING SYSTEM resulting code is more modular and maintainable than code written using more traditional techniques. A portion of the disclosure of this patent application 5 The fact that objects are encapsulated produces an contains material which is subject to copyright protec other important fringe bene?t that is sometimes referred tion. The copyright owner has no objection to the fac to as data abstraction. Abstraction is the process by simile reproduction by anyone of the patent disclosure, which complex ideas and structures are made more as it appears in the Patent and Trademark Of?ce patent understandable by the removal of detail and the gener ?les or records, but otherwise reserves all copyright alization of their behavior. From a software perspec rights whatsoever. tive, abstraction is in many ways the antithesis of hard coding. Consider a software windowing example: if FIELD OF THE INVENTION every detail of every window that appears on a user’s The present invention relates generally to object-ori screen in a graphical user interface (GUI)-based pro ented computing environments, and more particularly 5 gram had to have all of its state and behavior hard to a system and method for providing an object-ori coded into a program, then both the program and the ented interface for a procedural operating system. windows it contains would lose almost all of their ?exi bility. By abstracting the concept of a window into a BACKGROUND OF THE INVENTION window object, object-oriented systems permit the pro Object-oriented technology (OOT), which generally 20 grammer to think only about the speci?c aspects that includes object-oriented analysis (OOA), object-ori make a particular window unique. Behavior shared by ented design (00D), and object-oriented programming all windows, such as the ability to be dragged and (GOP), is earning its place as one of the most important moved, can be shared by all window objects. new technologies in software development. OOT has This leads to another basic component of OOT, already begun to prove its ability to create signi?cant which is the class. A class includes a set of data attri increases in productivity and in program butes plus a set of allowable operations (that is, meth maintainability. By engendering an environment in ods) on the data attributes. Each object is an instance of which data and the procedures that operate on the data some class. As a natural outgrowth of encapsulation and are combined into packages called objects, and by abstraction, OOT supports inheritance. A class (called a adopting a rule that demands that objects communicate subclass) may be derived from another class (called a with one another only through well-de?ned messaging base class, a'parent class, etc.) wherein the subclass paths, OOT removes much of the complexity of tradi inherits the data attributes and methods of the base tional, procedure-oriented programming. class. The subclass may specialize the base class by The following paragraphs present a brief overview of adding code which overrides the data and/or methods some of the more important aspects of OOT. More of the base class, or which adds new data attributes and detailed discussions of OOT are available in many pub methods. Thus, inheritance represents a mechanism by licly available documents, including Object Oriented which abstractions are made increasingly concrete as Design With Applications by Grady Booch (Benjamin/ subclasses are created for greater levels of specializa Cummings Publishing Company, 1991) and Object-Ori tion. Inheritance is a primary contributor to the in ented Requirements Analysis and Logical Design by Don creased programmer ef?ciency provided by OOP. In ald G. Firesmith (John Wiley 8r. Sons, Inc., 1993). The heritance makes it possible for developers to minimize basic component of OOT is the object. An object in the amount of new code they have to write to create cludes, and is characterized by, a set of data (also called applications. By providing a signi?cant portion of the attributes) and a set of operations (called methods) that functionality needed for a particular task, classes, in the can operate on the data. Generally, an object’s data may 45 inheritance hierarchy give the programmer a head start change only through the operation of the object’s meth to program design and creation. One potential draw ods. back to an object-oriented environment lies in the pro A method in an object is invoked by passing a mes liferation of objects that must exhibit behavior which is sage to the object (this process is called message pass similar and which one would like to use as a single ing). The message speci?es a method name and an argu 50 message name to describe. Consider, for example, an ment list. When the object receives the message, code object-oriented graphical environment: if a Draw mes associated with the named method is executed with the sage is sent to a Rectangle object, the Rectangle object formal parameters of the method bound to the corre responds by drawing a shape with four sides. A Trian sponding values in the argument list. Methods and mes gle object, on the other hand, responds by drawing a sage passing in OOT are analogous to procedures and shape with three sides. Ideally, the object that sends the procedure calls in procedure-oriented software envi Draw message remains unaware of either the type of ronments. However, while procedures operate to mod object to which the message is addressed or of how that ify and return passed parameters, methods operate to object that receives the message will draw itself in re modify the internal state of the associated objects (by sponse. If this ideal can be achieved, then it will be modifying the data contained therein). The combination relatively simple to add a new kind of shape later (for of data and methods in objects is called encapsulation. example, a hexagon) and leave the code sending the Perhaps the greatest single bene?t of encapsulation is Draw message completely unchanged. the fact that the state of any object can only be changed In conventional, procedure-oriented languages, such by well-de?ned methods associated with that object. a linguistic approach would wreak havoc. In OOT When the behavior of an object is con?ned to such 65 environments, the concept of polymorphism enables well-de?ned locations and interfaces, changes (that is, this to be done with impunity. As one consequence, code modi?cations) in the object will have minimal methods can be written that generically tell other ob impact on the other objects and elements in the system. ’ jects to do something without requiring the sending 5,379,432 3 4 object to have any knowledge at all about the way the oriented statements. Preferably, the class library in receiving object will understand the message. Software cludes: programs, be they object-oriented, procedure-oriented, (1) thread classes for enabling an application to access rule based, etc., almost always interact with the operat in an object-oriented manner operating system ing system to access the services provided by the oper 5 services to spawn, control, and obtain information ating system. For example, a software program may relating to threads; interact with the operating system in order to access (2) task classes for enabling an application to access in data in memory, to receive information relating to pro an object-oriented manner operating system ser cessor faults, to communicate with other processes, or vices to reference and control tasks, wherein the to schedule the execution of a process. 10 tasks each represents an execution environment for Most conventional operating systems are procedure threads respectively associated with the tasks; ‘oriented and include native procedural interfaces. Con (3) classes for enabling an application sequently, the services provided by these operating to access in an object-oriented manner operating systems can only be accessed by using the procedures system services to access and manipulate virtual de?ned by their respective procedural interfaces. If a memory in a computer; program needs to access a service provided by one of (4) interprocess communication (IPC) classes for these procedural operating systems, then the program enabling an application to access in an object-ori must include a statement to make the appropriate oper ented manner operating system services to commu ating system procedure call. 7his is the case, whether nicate with other threads during run-time execu the software program is object-oriented, procedure-ori tion of the application in a computer; ented, rule based, etc. Thus, conventional operating (5) synchronization classes for enabling an applica systems provide procedure-oriented environments in tion to access in an object-oriented manner operat which to develop and execute software. Some of the ing system services to synchronize execution of advantages of OCT are lost when an object-oriented threads; program is developed and executed in a procedure-ori (6) scheduling classes for enabling an application to ented environment. This is true, since all accesses to the access in an object-oriented manner operating sys procedural operating system must be implemented tem services to schedule execution of threads; using procedure calls de?ned by the operating system’s (7) fault classes for enabling an application to access native procedural interface. Consequently, some of the in an object-oriented manner operating system modularity, maintainability, and reusability advantages services to process system and user-de?ned proces sor faults; and associated with object-oriented programs are lost since (8) machine classes for enabling an application to it is not possible to utilize classes, objects, and other access in an object-oriented manner operating sys OOT features to their fullest extent possible. tem services to define and modify a host and pro One solution to this problem is to develop object-ori 35 cessor sets. ented operating systems having native object-oriented Further features and advantages of the present inven interfaces. While this ultimately may be the best solu tion, as well as the structure and operation of various tion, it currently is not a practical solution since the embodiments of the present invention, are described in resources required to modify all of the major, proce detail below with reference to the accompanying draw dural operating systems would be enormous. Also, such 40 ings, and in the claims. In the drawings, identical refer a modi?cation of these procedural operating systems ence numbers indicate identical or functionally similar would render useless thousands of procedure-oriented elements. software programs. Therefore, what is needed is a BRIEF DESCRIPTION OF THE DRAWINGS mechanism for enabling an object-oriented application The present invention will be described with refer to interact in an object-oriented manner with a proce 45 ence to the accompanying drawings, wherein: dural operating system having a native procedural in FIG. 1 illustrates a block diagram of a computer terface. platform in which a wrapper of the present invention SUMMARY OF THE INVENTION operates; FIG. 2 is a high-level flow chart illustrating the oper The present invention is directed to a system and ation of the present invention; method of enabling an object-oriented application to FIG. 3 is a more detailed ?owchart illustrating the access in an object-oriented manner a procedural oper operation of the present invention; ating system having a native procedural interface. The FIG. 4 is a block diagram of a code library containing system includes a computer and a memory component an object-oriented class library of the present invention; in the computer. A code library is stored in the memory 55 FIG. 5 is a class diagram c;f thread and task classes of component. The code library includes computer pro the present invention; gram logic implementing an object-oriented class li FIG. 6 is a class diagram of virtual memory classes of brary. The object-oriented class library comprises re the present invention; lated object-oriented classes for enabling the application FIGS. 7-9 are class diagrams of interprocess commu to access in an object-oriented manner services pro nication classes of the present invention; vided by the operating system. The object-oriented FIG. 10 is a class diagram of synchronization classes classes include methods for accessing the operating of the present invention; system services using procedural function calls compat FIG. 11 is a class diagram of scheduling classes of the ible with the native procedural interface of the operat present invention; ing system. The system also includes means for process 65 FIGS. 12-15 are class diagrams of fault classes of the ing object-oriented statements contained in the applica present invention; tion and de?ned by the class library by executing meth~ FIG. 16 is a class diagram of host and processor set ods from the class library corresponding to the object (machine) classes of the present invention; and