A relational/object-oriented database management system: R/OODBMS
Full text
(2)
(3) "J "O'. -ADUATE SCHOOL. -V. CALIFORNIA 93943-5002.
(4)
(5)
(6) UNCLASSIFIED ECURITY CLASSIFICATION OF THIS PAGE. REPORT DOCUMENTATION PAGE REPoRI SECURITY CLASSIFICATION. ia.. Ta. S E CUR IT Y CLASS FICA T ION AU T H6RI T V. 3.. I. 2b dECLASsII-ICA TI oN/D6WNgRA&. I. RESTRICTIVE:. 1b.. DISTRIBUTION/AVAILABILITY. Approved. Ng 5CHEDULL-. PERFORMING ORGANIZATION REPORT NUMBER(S). NAME OF PERFORMING ORGANIZATION. 6a.. 5.. OFFICE SYMBOL. 6b.. (if. Computer Science Dept.. CA. ADDRESS. 8c.. Naval Postgraduate School 7b.. 93943-5000. (City, State,. ADDRESS. (City, State,. Monterey, 6FFIcE SVMB6L. 8b.. (if. 9.. CA. TITLE (Include Security. .. A. and ZIP Code). 93943-5000. PROCUREMENT INSTRUMENT. ID£NTIFICATI6N. NUMBER. applicable). 10. SOURCE 6F FUNDING NUMBERS PROGRAM PROJECT TASK. and ZIP Code). ELEMENT NO.. 1 1. unlimited. NAME OF MONITORING ORGANIZATION. 7a.. 37. NAME 6F FUNdINg/SP6N56RINg ORGANIZATION. 8a.. is. MONITORING ORGANIZATION REPORT NUMBER(S). applicable). Naval Postgraduate School 6c. ADDRESS (City, State, and ZIP Code) Monterey,. 6P REPORT. for public release;. distribution 4.. MARKINGS. UNCLASSIFIED. WORK. UNIT. ACCESSION NO.. NO.. NO.. Classification). Relational/Object-Oriented Database. Management System: RIOODBMS. (U). PERSONAL AUTH6R(5). 12.. Spear, Ronald L. TV TYPE 6F REP6RT. 13b.. T3a.. Master's Thesis 16. SUPPLEMENTARY NOTATION. TIME COVERED. from. 14.. to 9/92. 8/90. The views expressed. DATE OF REPORT (Year, 1992 September 24. in this thesis are those of the. Month, Day). 15.. PAGE COUNT 226. author and do not reflect the official. policy or position of the Department of Defense or the United States Government.. GROUP. FIELD. SUBJECT TERMS. 18.. COSATI CODES. 17.. SUB-GROUP. (Continue on reverse. if. necessary and identify by block number). database, relational model, object-oriented model, object-oriented program-. ming, heterogeneous database 1. 9.. ABSTRACT. (Continue on reverse. During the. last. if. necessary and identify by block number). decade, the business sector has. become. trend will most likely continue. Deficiencies/constraints in. upon information management. This conventional database management systems continue to. increasingly reliant. become more apparent as this reliance continues to grow. Primary areas of deficiency are in modeling, storing, and managing increasingly complex information as in CAD and CASE among others. The purpose of this thesis is to implement a combined relational/object-oriented database management system that will overcome these deficiencies/constraints. Three possible approaches to such a system exist: build the system from on top of an existing relational system, or build relational capabilities on last approach is the one chosen for this work. This thesis expands prearea and uses a commercial object-oriented database management system, IDB, in its implemen-. scratch, build object-oriented capabilities. top of an existing object-oriented system.. vious work in this. The. tation.. DISTRIBUTION/AVAILABILITY oF ABSTRACT ] SAME AS RPT. [J UNCLASSIFIED/UNLIMITED 22a NAME OF RESPONSIBLE INDIVIDUAL Dr. Michael L. Nelson 20.. 21.. ] DTIC USERS. DD FORM. 1473, 84. MAR. 83. TELEPHONE. (Include. (408) 646-2026. APR edition may All. UNCLASSIFIED 22b.. .. ABSTRACT SECURITY CLASSIFICATION. be used. until. exhausted. other editions are obsolete. Area Code). 22c.. OFFICE SYMBOL. CS/Ne. SECURITY CLASSIFICATION OF THIS PAGE.
(7) Approved. A. for public release; distribution. is. unlimited. Management System:. Relational/Object-Oriented Database. RIOODBMS. by Ronald L. Spear Captain, United States. Army. B.A., Concordia College. Submitted. ,. 1983. in partial fulfillment. of the. requirements for the degree of. MASTER OF SCIENCE. IN. COMPUTER SCIENCE. from the. NAVAL POSTGRADUATE SCHOOL September 1992.
(8) ABSTRACT During the. last. decade, the business sector has become increasingly reliant upon. information management. This trend will most likely continue. Deficiencies/constraints in. conventional database management systems continue to become more apparent as. this. reliance continues to grow. Primary areas of deficiency are in modeling, storing, and. managing increasingly complex information. The purpose of. this thesis is to. as in. CAD and CASE among others.. implement a combined relational/object-oriented. database management system that will overcome these deficiencies/constraints. Three possible approaches to such a system exist: build the system. from. scratch, build object-. oriented capabilities on top of an existing relational system, or build relational capabilities. on top of an existing object-oriented system. The work. This thesis expands previous work in database management system, IDB, in. its. last. this area. approach. the one chosen for this. and uses a commercial object-oriented. implementation.. in. is.
(9) t.l. TABLE OF CONTENTS I.. INTRODUCTION A.. MOTIVATION. B.. OBJECTIVES OF A RELATIONAL/OBJECT-ORIENTED. C.. H.. 1. 1. DATABASE SYSTEM. 2. RESEARCH OVERVIEW. 3. SURVEY OF THE LITURATURE. 4. A.. GENERAL. 4. B.. OBJECT-ORIENTED PROGRAMMING CONCEPTS. 4. C. 1.. Classes/Objects. 5. 2.. Methods. 7. 3.. Inheritance. 8. 4.. Encapsulation. 12. RELATIONAL DATABASE MANAGEMENT SYSTEMS 1.. 2.. 3.. Relational. Model Concepts. 13. 14. a.. Relations. 14. b.. Schemas and Constraints. 17. c.. Operations. 18. Formal Query Languages. 19. a.. Relational Algebra. 19. b.. Relational Calculus. 24. Other Query Languages. 25. a.. SQL. 25. b.. QUEL. 26. c.. QBE. 27. IV.
(10) ,CAUFOfiN'A. D.. OBJECT-ORIENTED DATABASES. HI.. 27. 1.. Object-Oriented Model Concepts. 28. 2.. Object-Oriented Database Systems. 29. 3.. IDB Object Database Overview. 31. 4.. E.. 93943-5002. a.. General Information. 31. b.. Clusters and Structures. 32. c.. Nodes, References and Attributes. 35. d.. Transactions. 38. Other Systems. 39. a.. ONTOS/Vbase. 39. b.. GemStone. 40. c.. POSTGRES. 42. PREVIOUS. WORK. 43. 1.. ROOMS. 2.. Implementing Relational Operations. 43 in. Prograph. DETAILED PROBLEM STATEMENT. 44 45. A.. GENERAL. 45. B.. RELATIONAL DATABASE LIMITATIONS. 45. C.. 1.. Simple Data Types. 45. 2.. Tuple Function. 47. 3.. Inheritance. 48. 4.. Impedance Mismatch. 49. OBJECT-ORIENTED DATABASE LIMITATIONS. 49. 1.. Mathematical Foundation. 50. 2.. Standardization. 50. 3.. Relational Operations. 51. v.
(11) 4.. D.. E.. IV.. Other Problems. 52. A COMBINED SYSTEM. 52. 1.. Desirable Properties. 52. 2.. Possible Approaches. 53. WHY THIS APPROACH. 53. IMPLEMENTATION OF AN R/OODBMS IN IDB. 55. A.. THE SYSTEM DESIGN. 55. B.. ORIENTATION TO R/OODBMS. 58. C.. D.. E.. 1.. The Database Directory. 2.. Inside a. R/OODBMS. Database. RELATIONAL METHODS. 58. 59 62. 1.. Union. 64. 2.. Difference. 66. 3.. Selection. 68. 4.. Cartesian Product. 70. 5.. Projection. 74. THE DATABASE CLASS. 76. 1.. Attributes. 76. 2.. Methods. 77. THE RELATION CLASS. 78. Attributes. 78. 1.. a.. Relation_name. 78. b.. Attribute_names. 78. c.. Attribute_types. 79. d.. Tuples. 79. e.. Tuple_type. 80. vi.
(12) f.. 2.. 82. Methods. 82. THE TUPLE CLASS. F.. 82. 1.. Attributes. 83. 2.. Methods. 83. 3.. V.. Key. 83. a.. Initialize_tuple. b.. Insert_fields. c.. Comparison methods. and Insert_tuples. User Definitions. 85 87. ALTERNATIVE PROJECT AND CARTESIAN PRODUCT. IMPLEMENTATIONS. 88. A.. GENERAL. 88. B.. IDB TYPES. 89. C.. THE RESULT_TUPLE SUBCLASS. 90. D.. THE MODIFIED OPERATIONS. 91. 1.. Project. 91. 2.. CARTESIAN PRODUCT. 95. E.. VI.. 83. CONCLUSIONS. 97. CONCLUSION. 99. A.. SUMMARY. B.. CONCLUSIONS. 100. C.. FUTURE RESEARCH SUGGESTIONS. 100. 99. APPENDIX A. EXAMPLE IDL SCHEMA. 104. APPENDIX B. DATABASE DIRECTORY SOURCE CODE. 105. APPENDIX C. R/OODBMS SOURCE CODE. 110. vn.
(13) '. APPENDIX D. :. A SAMPLE R/OODBMS DATABASE ASCII. CLUSTER FILE. 178. APPENDIX E. MODIFIED R/OODBMS SCHEMA. 186. APPENDIX F. MODIFIED PROJECT. 190. APPENDIX G. MODIFIED CARTESIAN PRODUCT. 199. LIST OF. REFERENCES. 206. BIBLIOGRAPHY. 211. INITIAL DISTRIBUTION LIST. 212. vui.
(14) 1. LIST OF FIGURES. Class Definition Example. 7. Figure 2. A. Class and. 9. Figure 3. A. Simple Inheritance Hierarchy. Figure 4. A More. Figure 5. A Multiple. Figure 6. Sample Relational Database. 15. Figure 7. Reordered Officer Relation. 16. Figure 8. Sample Relational Database Schema. 17. Figure 9. Example Result of a. 21. Figure 10. Example Result of a Project Operation. 22. Figure. Union Compatible Relations and Result of Union. 23. Figure. 1. 1 1. Its. Subclass. Complex. 9. Inheritance Hierarchy. 10. Inheritance Lattice. 1. Select Operation. 24. Figure 12. Result of Difference Operation on Relations in Figure. Figure 13. OODBMS. Figure 14. An Example. Figure 15. A Class Hierarchy. Figure 16. Universal Types [Pe91c,. Figure 17. IDB Browser. Figure 18. Entering a Database. Figure 19. The Relational Address. Figure 20. The Relation. Figure 21. Union Query. 65. Figure 22. Difference Query. 67. Figure 23. Select. Figure 24. Cartesian Product Query. 1 1. 30. Manifesto of a Directed Attribute Graph. [NMSW83,. p. 8]. 35 36 37. p. 36]. 56. Interface. 59. DB. 60 61. ptl. Query. 69 71. IX.
(15) Figure 25. DDL Schema. Figure 26. Example Resultant Relation Schema. Employee and Assigned Project Relations. for. for a. Cartesian Product Operation. and One of. 72. 72. Figure 27. The Relation. r3. Figure 28. The Relation. ptl. 74. Figure 29. Cartesian Product of r3 and ptl. 74. Figure 30. Project. Figure 31. Example Resultant Relation Schema. Figure 32. Person, Addr,. Figure 33. IDL Types. Figure 34. Resultant Relation. Figure 35. Modified Project Query. Figure 36. Template. Figure 37. Modified Cartesian Product Query. its. Tuples. 73. Query. 75 for a Project Operation. Phone_number Class Definitions. [Pe91c,. p.. 86. 90. 62]. Schema. 76. for Project. and Cartesian Product. 92. ,. for Overriding Insert_fields_b. 91. Method. 95. 96.
(16) ACKNOWLEDGEMENTS I. would. thank Dr. Nelson,. like to take this opportunity to. When. and guidance.. I. would get bogged down. Nelson provided much needed focus which lead thesis process, his thoughtful questions. more to. what. carefully. I. to a. provoked. was doing and what. in the. advisor, for his support. coding of our. R/OODBMS,. Dr.. working system. Throughout the entire. my thinking which helped me to consider. needed. I. my. to do.. He. could always be counted on. provide timely and constructive feedback.. Thanks. also goes to. my. second reader, Dr. Wu, for his time in effort in assisting with. my thesis. He was also quite helpful in the conducting the research necessary for the survey of the literature.. Ellen Borison and John Nestor, of Persistent Data Systems, were of great assistance in. making the IDB learning curve a. you both. A. for your patience in. (P) Rothlisberger,. CPT. answering. special thanks goes to. my. less steep. little. my. fellow. by providing excellent support. Thank. sometimes. Army. trivial questions.. officers of class. CPT Nash, CPT Warren, CPT Tharpe, CPT. CS 1 1 CPT :. during the. it. to the last quarter. first. CPT. Hoppe, CPT(P) Reese, and. Weigeshoff. Without their fellowship, camaraderie, and assistance,. have made. Walter,. I. would never. with a completed thesis. Their support was invaluable. quarter of the curriculum. when. I. had unfortunately missed a. third of the. quarter. Finally,. I. would. like to. my. thank. unwavering throughout our entire time never complained and only supported. here.. my. lovely wife Karin. Even during. efforts to. my longest days of studying,. succeed here.. without her. Bryan and Devin could always be counted on to take. we were. together, thank. you. both.. XI. whose support has been. I. she. could not have done. it. my mind off studies when.
(17)
(18) I.. A.. INTRODUCTION. MOTIVATION The. popularity of Object-Oriented. more and more people develop an. Programming (OOP). is. steadily increasing.. interest in the additional capabilities that arise. the object-oriented paradigm, they realize the flexibility and. power. that. As. from using. OOP provides for. representing real world objects in an intuitive and natural manner. This flexibility and high level of abstraction provided. by. OOP constructs. many. has lead. consider object-oriented concepts as they relate to database. During the. last. database professionals to. management systems (DBMS).. decade, the business sector has become increasingly reliant upon. information. Information. management and. control pays dividends to businesses in terms of. increased power and revenue. In the coming decade, this reliance will surely increase.. The. requirement to manage very large quantities of data more efficiently and to perform queries. on them rapidly. manage. is. is. only part of the problem. The data that businesses wish to store and. becoming increasingly complex.. Some. specific areas that. complex data. are. have an immediate need for a database. to store. and manage. computer aided design (CAD), computer aided software engineering. (CASE), computer-integrated manufacturing (CIM), and computer aided engineering. Data representing images and text field, for. is. applicable to virtually. example, a patient's medical. file. all. large businesses. In the medical. could be managed by a database that keeps track. of not only the textual records from an appointment, but also x-rays, lab results, cat scan pictures,. and other non-textual information. [Me90]. The. relational data. model has existed. for. many. years.. It. was developed by Codd. in. 1970 [Co70]. This model quickly gained widespread acceptance and use commercially..
(19) Much. of the business sector has a heavy investment in relational databases, and the. model. relational. credible and familiar. Therefore, there. is. another model/system, even. when. is. a reluctance to change to. there is a need.. Vendors have realized the need for modeling complex information audible,. (OODBMS). response,. In. etc.).. now. are. object-oriented. several. databases. available in the commercial market.. managing complex data. are using them.. Many. Some. (visual, textual,. management systems. businesses with a need for. of these businesses have expressed a desire. for an interface that can access both object-oriented databases. and relational databases. [St91a].. OBJECTIVES OF A RELATIONAL/OBJECT-ORIENTED DATABASE. B.. SYSTEM In general, conventional database. As Hsiao. specific need.. models are designed. states, "this is the. to. meet the requirements of. notion of application specificity,. specific to a kind of database application."[Hs91, p.. 3]. The general. i.e.,. a. being. areas that the. conventional data models, relational, hierarchical, network, and functional data models, are. used for are record keeping, product assemblies, inventory controls, and inference making, respectively [Hs9 1 ] .. The main that. objective of this research. would serve. (RDBMS). has. constraints. on. Both. The. determine. if. a single. DBMS. the needs of both relational and object-oriented users.. many advantages over. can be realized. A relational DBMS. non-relational systems. There are, however,. relations, such as the type of real. An OODBMS objects.. is to. world. entities that. it. some. can represent.. has a more robust capability for representing real world entities as. restriction. on types of relations. in a. RDBMS. can be. lifted in. an. OODBMS.. RDBMSs and OODBMSs have their own set of advantages, but they are not the same. set of advantages.. It is. desirable to have a. DBMS. that has the. advantages found. in. both of.
(20) these sets, plus any additional advantages that object-oriented database. The. user of a. may arise from having a combined relational/. management system (R/OODBMS).. R/OODBMS. should be able to implement a relational schema and query. the database using either 'standard' relational queries or an object-oriented type query.. Thus, there would be a very low learning curve for users already accustomed to relational systems. Additionally, they would not have to abandon the relational approach that they are already familiar with for this capability to. A. manage complex. secondary objective. OODBMS.. OODBMS. new. That. is,. so that a. data/objects with the. is to. determine. if. any. R/OODBMS. also gain the. same system.. OODBMS. are there certain requirements that. can be the basis for a R/. must be met by a commercial. can be successfully constructed? Also, are there any. characteristics of these systems that. C.. would. object-oriented paradigm. Yet, they. would. facilitate this construction. more than others?. RESEARCH OVERVIEW This. is. a feasibility study which continues previous. work done. [Ne881 and Filippi [Fi92]. Implementing relational operations in. in the area. IDB. is. by Nelson. the primary thrust. of this research. Additionally, assessing the capabilities and advantages of using both. RDBMSs. and. OODBMSs. falls. within the scope of this research.. assessments with that of a single. whether the needs of a. R/OODBMS. A. will follow so that. comparison of these it. can be determined. RDBMS and an OODBMS can be satisfied by a single R/OODBMS..
(21) II.. SURVEY OF THE LITURATURE. GENERAL. A.. The focus of this chapter oriented. programming (OOP),. object-oriented database is. is. and concepts. the fundamental terms. relational database. in the areas of object-. management systems (RDBMS), and. management systems (OODBMS). The discussion of these. not intended to be a complete. work on them, but. topics. rather an introduction to present those. concepts and terms necessary as a foundation for this thesis.. B.. OBJECT-ORIENTED PROGRAMMING CONCEPTS "I. have a cat named Trash. In the current political climate,. trying to sell. humans and. him is. a. (at least to. Computer. self-sufficient, living. Scientist), I. it. would not. would seem that if I were stress that. mostly on field mice. Rather,. I. he. is. would argue. gentle to that. he. is. object-oriented" [Kin89, p. 23].. What does 67. mean. 1960s and. the. in. it. for. something. later. to. be object-oriented? Since the advent of Simula-. Smalltalk in the. programming languages (OOPLs) and. 1970s [Mi88][Mo89], object-oriented. the object-oriented. paradigm have been increasingly. great topics for discussion and debate. Different products are advertised as object-oriented, the. hot. however. buzzword,. there. is. no. universally. accepted. definition. [Kin89][Ne91][Ne90b][SB86].. "What of. OOP,. [Ne91,. is. needed. yet strong. p. 4].. is. a definition general. enough. The broad. to stand. enough. is. encompass. all. of the current views. up as the basis for the underlying theory of. definition used in this paper. + inheritance + encapsulation. This. to. is. object-oriented. =. objects. a slight modification of the definition in. +. OOP". classes. [We87]..
(22) Currently, there. is. also. much. debate about the design process for an. OOP. program.. In conventional languages, several approaches have been formalized such as the top-down,. bottom-up, structured,. OOP. etc.. These approaches. are, in general, 'action'. uses an 'object' approach [GH91b]. However, the. OOP. approaches while. community. established methodology to their 'object' approach [PN91b]. This subject. is. lacks any. considered to. be beyond the scope of this paper, however, and as such will not be discussed any further.. Classes/Objects. 1.. A p. 43].. An. may. class. object. be defined as "a description of one or more similar objects" [SB86,. an instantiation of a class [Mo89]. Clearly,. is. which can be avoided by defining an object an object. is. as the. this is a circular definition. fundamental element of OOP. That. a self-contained set of variables (which. may. is,. be thought of as attributes in. database terms), and responds only to messages to execute specific defined procedures (also called. methods. in. OOP terms). [BM91][Ne91][SB86].. only means by which manipulation of. The. its. An. object's method(s) are the. variables can occur.. description of an object/class. is. composed of. variables/attributes. and the. procedures/methods that operate on them. These variables and methods describe general characteristics that all instances of a class have.. object. is. through messages to execute. interface to a particular object.. 1.. [We87] defines. this. equation. is. Thus, a class. to. communicate with an. important point. is. that the variables of an object. may. OOP as "object-oriented = objects + classes + inheritance". It may be argued that same as our slightly modified equation more detailed discussion, see [Ne91]. may be. ADT [Da84][Ne91]. class.. to. methods. Thus, an object's messages are the. the. capsulation. For a. 2.. An. its. The only way. since. thought of as an abstract data type. The. interface to the data type. The implementation of these methods. be implementation-independent.. is. is. some. (ADT). definitions of class imply en-. or as the implementation of an. defined solely by the methods defined for the. contained within the class which allows the interface.
(23) themselves be objects. In. one variable which. this case, the object is called a. composite object that has. a previously defined object [EN89][Ne90b].. is. The composition of. composite objects can be compared with inheritance where composition inheritance the later. Most. is. a. method. value. is. in. a form of part. OOP languages provide for both class and instance variables, although be considered object-oriented. that a class variable will. is. is. concerned more with behavior inheritance [Ne90b].. not required for a language to difference. at least. have the same value for. all. it. [Ne91][Ne90b]. The. instances of the class. If. any of the instances of that class change the value of a class variable, then the. changed for every instance of the. class.. Thus,. it is. a variable shared. by. all. instances. of the class. In contrast, an instance variable has a local value for a particular instance.. change. is. to the. A. value of an instances instance variable of one object has no effect on the. corresponding variable in another instance of the class.. Consider a military officer as an example of an entity that might be described in a class definition.. The. characterize an officer.. class. A. name could be. would have. the. CompanyGradeCount. Thus, every instance of. same value. for. CompanyGradeCount. Each. name, grade, social security number, and an assigned unit instance variables. number of company grade. possible class variable could be the. officers (0-1 through 0-3) that exist:. Officer class. Officer with several variables that further. Name, Grade, SSN, and. that. Unit, respectively.. may. the. officer has a. be represented by the. These variables would be. instance variables since each instance of an officer will not necessarily have the. same. values for each of these variables. This officer class definition. 1.. is. presented in Figure. IDB, the OODBMS used in this thesis, does not provide the capability to define class variables. However, in our discussions with Persistent Data Systems, they have mentioned that later versions 3.. of. IDB may. contain this capability..
(24) Class: Officer. Superclass:. none. Class Variables:. CompanyGradeCount. Instance Variables:. Name, Grade, SSN, Unit. Methods:. Promote, Retire, Relocate. Figure. As. previously mentioned, methods are the means by which an objects variables. are manipulated [Ne90b].. A. Example. Methods. 2.. object.. 1 Class Definition. A. method. is. They define. invoked by sending an object a message. message can be likened. to a. Changing the implementation needed. to. invocation of class. the only legal actions/operations that characterize an. procedure. details for. call in a. to. invoke one of. its. methods.. conventional programming language.. any method should have no effect on messages. invoke that method [Ne90b]. Thus, code that uses message passing for method is. implementation independent.. may imply. It is. in this sense that the description/definition. encapsulation (also called information hiding).. In our military officer example,. it. may. be desirable. or relocate an officer. Therefore, these three actions might be. to. be able to promote,. retire,. implemented as methods. The Promote method would change. for. Grade instance. the Officer class (see Figure. 1).. variable and could change the. CompanyGradeCount class variable; Relocate would change. 4.. The exact implementation. for the. the. message passing concept may vary among different. guages.Value operations (idl_vop) and type operations (idl_top) are the means by which. ments message passing.. OOP lan-. IDB. imple-.
(25) the Unit instance variable;. and Retire would change the Unit and Grade instance variables,. and possibly the CompanyGradeCount class variable.. 3.. Inheritance Inheritance allows further specialization of a class (called the superclass) by. exploiting class similarities [Ni89]. That. of. ancestors and adds. its. of. its. ancestors. its. and. is,. a subclass inherits the variables and. own. variables and methods.. its. ancestors. [BM91][CY90][HO87][Hs91][Mi88][Mo89]. code sharing [Ne90b] that travel. they. down an. become more. In. is. a specialization. of. more fundamental terms,. the it is. subclass a form of. ,. classes. become more. specialized.. As you. travel up,. generalized.. In Figure 2, the class. Human. is. the superclass of the subclass ServiceMember.. simple inheritance hierarchy of these two classes will. generalization. it. and encourages code reuse [Ni89][Mi88]. As you. facilitates. inheritance hierarchy. a. are. In this way,. methods. is. shown in Figure. 3.. A. Any ServiceMember. have Species as a class variable; Weight, Height, Sex, and Ssn as instance variables;. and the methods Bom, Die, EnterService, and DepartService. specialization of a. Human, while. a. Human. 5.. Inheritance of methods. is. called structural inheritance [Da90].. 6.. An. is. inheritance hierarchy. tween classes [Ne90b).. is. a generalization of a. A. ServiceMember. is. ServiceMember.. sometimes called behavioral inheritance while inheritance of variables. is. simply a graphical representation of the inheritance relationship be-. a.
(26) Human. Class:. Superclass:. none. Class Variables:. Species. Instance Variables:. Weight, Height, Sex. Methods:. Born, Die. ServiceMember. Class:. Superclass:. Human. Class Variables:. none. Instance Variables:. Ssn. Methods:. EnterService, DepartService. Figure 2. A Class and Its Subclass. Human. ServiceMember Figure 3 A Simple. Consider the inheritance hierarchy. Inheritance Hierarchy. in. ServiceMember. The ancestors of Officer are. Figure 4, Officer. is. now. a subclass of. Human and ServiceMember,. while. its. descendents are the subclasses CompanyGrade, FieldGrade, and FlagGrade. Thus, the class Officer inherits. all. the variables and. Again, you can see that as you travel. more. methods from both. down. Human and ServiceMember.. the inheritance hierarchy the classes. specialized while the classes higher in the hierarchy are. 7.. The Officer class. is. now. its. definition in Figure. superclass.. 1. would have. to. more. be modified to. become. general.. reflect that. ServiceMember.
(27) Human. ServiceMember. Enlisted. Officer. Company. Field. Flag. Grade. Grade. Grade. Figure 4 A More Complex. Methods. that are inherited. (or redefined) while. methods. still. by a class may have. maintaining the same method. same message may be sent. to different objects,. same method depending on. the object. polymorphism. is. implementation overridden. name [H087][Mi88]. This allows is,. the. invoking different implementations of the. which receives the message.. that of the binary arithmetic operations. When we want to add two integers, we. write 2+39; the. A common example of. on integers and. same operator name. real. numbers.. '+' is also. used. numbers, 3.4+2.1.. In the. example hierarchy (Figure. method Promote (along with subclasses (except for. the other. CompanyGradeCount.. of Officer. class).. all inherit. the. However, each of the. require a different implementation for the Promote. a FlagGrade or FieldGrade officer Q. class variable. 4), the subclasses. methods of the Officer. CompanyGrade). method since promoting. a. their. overloaded (also called polymorphism) [Ne90b][Ni89][SB86]. That. to be. for the real. Inheritance Hierarchy. A. method. polymorphic method.. 10. that has. would not change. the Officer. been overwritten by a subclass. is.
(28) Up. our discussion of inheritance has focused only on single. to this point,. inheritance: a class inherits. from only one superclass. However, some languages allow. more superclasses [Ne91][Ne90b]. The. multiple inheritance: a class inherits from two or relationship. for. between classes when multiple inheritance. is. allowed can be shown. (see Figure 5) [SB86][Ne90b].. graphically in a multiple inheritance lattice. Human. ServiceMember. Student. Enlisted. Officer. Nps Student Figure 5 A. Inheritance. is. not without. its. Multiple Inheritance Lattice. own. special. problem which must be mentioned;. of name conflicts [Ki91][Mi88][Ne88][NMO90]. In Figure. 8.. This assumes that. 5,. assume. that the. Human class. Promote method has the implementation preCompanyGradeCount class variable. Thus, if not overwritten a message sent to any of Officer's subclasses would. in the Officer class definition the. viously described: Promote changes the value of the the method's implementation. invoke 9.. this. is. implementation causing undesirable. Generally, the term inheritance by itself. 10.. The term. lattice. common. results.. means only. single inheritance [Ne90b].. by definition allows more than one superclass [SB86] while an inheritance. erarchy does not. This. is. that. in contrast to a hierarchy. which. is. practice to refer to a multiple inheritance lattice. erarchy [Ne90b].. 11. represented as a tree. However,. more simple. it. hi-. is fairly. as a multiple inheritance hi-.
(29) has a Print method that has been overridden in both the Officer and Student subclasses.. Now,. consider the class NpsStudent; which implementation of Print does In the case of single inheritance, a subclass. from. its. ancestors but also have a different method. subclass [Ni89][NMO90]. That. and a variable Y. locally defined. the. How. are the. is,. X or variable Y defined locally for the. name with. default criteria [SB86]. distinguishing. method. X. It is. among them [Ne88]. superX or superY.. super; for example, it is. complicated since. not as simple to just preface a redefined. super since more than one of the superclasses. some. class definition a. name problem, however. more than one superclass involved.. [Ni89]), by. its. the overridden method/variable in the. variable name. In general, the possible solutions include. using. X or variable Y. methods and variables override any inherited methods and variables with. Multiple inheritance has a similar. name with. method. inherit?. two different methods or variables differentiated? Usually. superclass to be accessed by prefacing the. is. inherit a. the subclass also has in. same name. However, some systems allow. there. may. it. may have. the. same method/. making a choice between them. (such as a class precedence [Mo89][SB86]), by. (possibly by using their parent class. name. combining them [Mo89][Ne88], or by requiring the programmer. as a prefix to. make an. explicit choice [Ki91][Mi88][Ni89].. 4.. Encapsulation. "An OOPL. supports encapsulation. via their external interfaces" [Mi88, p. 15]. its. methods and these. object.. The user. is. to. means. The. allows users of objects to access them only external (public) interfaces to an object are. that a user has for accessing/manipulating an. not allowed direct access to the object and. Thus, encapsulation protection. are the only. if it. is. a. its. inner workings[Da90].. method of information hiding [Da90][Ne90b][Ne91] and. objects from. unauthorized/illegal. operations on. its. variables. offers. [Mo89].. Additionally, hiding implementation details provides a separation (or decoupling) from the. 12.
(30) code. and implements an object from. that defines. [Da90]. This point. is. quite important since. it. that of the. program code using. the object. allows changes to an object's implementation. without having to change the user's program code and vice-verse [Da90][Mo89][Ne91].. RELATIONAL DATABASE MANAGEMENT SYSTEMS. C.. Prior to discussing the relational. model. specifically,. it is. worth giving a few moments. management system (DBMS).. to the definition of a database. A DBMS. is. a collection of. general-purpose software programs that allow maintenance of and access to a collection of. However, when discussed little. more. A collection of interrelated data is called a database.. [EN89][KS86].. interrelated data. restrictive. in. terms of specific. the collection of data has. •. the database. is. the database. inherit. applications;. models and. The maintenance of and access (i.e.,. some. query and update). the. same data. duplication of effort to update the data. may. DBMS. logically coherent;. reflects. to. some. it;. is. real. world aspect.. the data include facilities to define, create,. is critical to. and. it.. DBMS.. stored increases, there. additionally,. it is. more. Controlling redundancy: as the is. a corresponding increase in. likely that inconsistencies. arise (update anomalies). Sharing of data: in a multiuser. control of updates the. is. and. There are numerous considerations for using a. number of times. meaning and. created for a specific purpose, an intended group of users, and. some preconceived. manipulate. the definition of database is a. and has the following properties[EN89]:. •. •. DBMSs,. among. DBMS concurrency. the correctness of updates. Restricting unauthorized access:. should allow restrictions to be placed on access to database data. Representing. complex relationships among. data: this includes easy. and efficient retrieval and update of. related data. Enforcing integrity constraints: database designers. data constraints which the. DBMS. must be allowed. to specify. can enforce automatically or which can be enforced by. 13.
(31) update programs. Provide backup and recovery: recovery from hardware and software failures is the. DBMS's responsibility. [EN89][KS86]. Relational. 1.. Model Concepts. In 1968, Dr.. Edgar. F.. Codd had. the idea that "predicate logic could be applied to. maintaining the logical integrity of the data" in a. conception of the relational data model.. Two. years. paper published in the Communications of the. had. until that. ACM. DBMS later,. [CD90,. Codd introduced. [Co70].. It. This was the. p. 35].. his. model. in a. was a departure from what. time been the conventional models (hierarchical data model and the network. data model) since his model allowed for a. more. abstract representation of the database. [OV91][KS86][Fi92]. This simplistic yet complete model has evolved into a kind of defacto standard in the database industry.. The. relational. model. is. firmly founded in strong mathematical concepts and. theory. Predicate logic and set theory are the primary foundation. model. rests.. This allows a formalism in the. in the context of the. a.. way. upon which. that data is represented. the relational. and manipulated. model.. Relations. The. relational. model represents. a database as a collection of relations.. Relations, the fundamental building block of the model, are represented by the intuitive. notion of a table (or. flat file). of values [Da84][EN89][KS86][OV91][SSU91]. Each. the table represents a tuple of the relation. related.. The columns of. A. tuple. is. a collection of data values that are. the table represent attributes of the relation (see Figure 6). In the. sample relational database, there are two. relations: Officer. interpreted as a fact that describes a relation instance.. must be atomic. That. row of. is, it is. and Military Unit. Each tuple. Every. attribute value within a tuple. not constructed of other components;. 14. is. it is. indivisible..
(32) Officer. Name. SSN. Unit. Spear. 550-34-2453. 3BDE. Walter. 233-45-3423. 2BDE. Nash. 241-4500974. 1BDE. Rothlisberger. 123-45-6789. 3BDE. UnitName. Location. CdrSSN. 1BDE. Grafenwohr. 123-45-6789. 2BDE. Erlangen. 550-34-2453. 3BDE. Bamberg. 233-45-3423. MilitaryUnit. Figure 6 Sample Relational Database. However,. it. between a relation and a. must be understood table.. relation are represented as the. the. rows of a. Figure 7. 11.. is. A. that there is a subtle but important difference. relation is a set of tuples.. rows of a. table.. A. set. On. the other hand, tuples of a. by definition. is. unordered, but clearly. table are ordered (from top to bottom)[EN89]. Thus, the relation Officer in. the. same. as the Officer relation in Figure 6.. This requirement for atomic attributes. is. called the first normal form. Normalization. of decomposing relational schemas into smaller relations that conform to several ond, and third normal forms.. The goal of normalization. is. is. a process. criteria: first, sec-. to aid database designers in analyzing. a. database schema and developing a database with a 'good' design that avoids update anomalies.. [EN89]. 15.
(33) By. the. same token,. columns. the order of the. is. not important since a tuple can. be thought of as a set of (<attribute>,<value>) pairs[EN89][Da84]. The value. must fall within. the. domain of its associated. Thus, the. attribute.. first. in. each pah-. tuple in Figure 7 could. be written: (Name,Rothlisberger), (SSN, 123-45-6789), (Unit,3BDE); or (Unit,3BDE), (Name,Rothlisberger), (SSN, 123-45-6789);. etc.. Officer. Name. SSN. Unit. Rothlisberger. 123-45-6789. 3BDE. Nash. 241-4500974. 1BDE. Spear. 550-34-2453. 3BDE. Walter. 233-45-3423. 2BDE. Figure 7 Reordered Officer Relation. The reason will. between relations and tables. this subtle difference. become more apparent later. As will be discussed,. all. is. important. of the relational algebra operators. take relations as parameters and yield results that are also relations [Da84]. Thus, they are set operations. and they have firm foundations. in. mathematical set theory. Consequently,. someone has a good understanding of mathematical. way. to. set theory,. if. then they are well on their. understanding relational algebra.. Another consequence of a relation being defined as a definition,. each element. set of tuples, is that,. in a set is unique. Therefore, all tuples in a relation. by. must be unique.. This implies that there are no two tuples in a relation that have the same combination of values for. all attributes. [EN89]. Thus, there. is. some combination of. each tuple of a relation to be uniquely identified; (the. primary key of each relation. in. this. combination. Figure 6 and Figure 7. 16. is. is. attributes that allows. called a primary key. underlined). In the worst case,.
(34) the primary. key. is. the set of all attributes of the relation [Da84][EN89].. A. detailed. discussion of keys (including superkeys, minimal superkeys, candidate keys, primary keys,. and foreign keys) can be found. b.. in. [EN89].. Schemas and Constraints. When. discussing databases,. database schema and database instance.. is. it. A database schema is a set of relation schemas and. a set of integrity constraints while an instance. The type. correspondence. to a relation. is. a snap-shot of the data in the database at. A relational. a given instant in time[KS86][EN89]. for the relation.. important to differentiate between the. schema can be thought of as a template. programming language notation bears. definition in. schema [KS86]. The schema. intention of the relation while the instance. is. is. known,. a close. in database terms, as. the extension [EN89].. In the previous examples (Figure 6 and Figure 7), the Officer relation and the. Military Unit relation are both examples of a relation instance. Figure 8. schemas for the Officer and Military Unit listing of the relation's attributes. •. Officer-scheme =. •. Military Unit-scheme. and. (Name. their. :. relations.. Another notation for a schema. string,. SSN. = (UnitName. :. :. integer, Unit. string,. Location. :. :. SSN. Unit. Location. CdrSSN. MilitaryUnit. UnitName. Figure 8 Sample. is. a. corresponding domains[KS86]:. Officer. Name. shows the relational. Relational Database. 17. Schema. string). string,. CdrSsn. :. integer).
(35) In general, integrity constraints are defined for a database. schema and should. hold for every instance of the schema [EN89]. There are several types of integrity constraints:. key constraints, entity. integrity constraints,. and. referential integrity constraints. [Da84][EN89][OV91]. Key constraints are concerned with ensuring the uniqueness of key values for every tuple in any relation instance of a schema. Entity integrity constraints restrict. primary key values. to. be non-null [OV91]. Finally, referential integrity constraints. maintain consistency between tuples of two relations [OV91]. That. must. relation refers to another relation, then. it. additional general constraint that. sometimes needed. is. is, if. refer to a tuple that exists in that relation.. commander. c.. Delete and insert do what. some. or. is. expected. is to. are not violated. Therefore,. -. insert. relations:. and delete. modify, delete, and. tuples, respectively.. of a tuple to be changed.. all attributes. performing these operations. schema. ensure that the integrity constraints defined for the if. any. integrity constraints. would be violated by the. correct the reason that the operation violates integrity constraints. It. constraints. constraint.. is. key. possible for an insert operation to violate constraints,. Modify. The most important aspect. update operation, then either the operation can be rejected or the system. constraints:. that. Operations. allows values of in. would be. of his unit'.. Three fundamental update operations exist for insert.. An. called a semantic integrity. is. constraint [EN89]. In our military example, a semantic integrity constraint 'an officer in a unit cannot outrank the. a tuple in one. entity. integrity. constraints,. However, the delete operation can only Both key constraints and. may. attempt to. [EN89]. all. and. three of the integrity referential. integrity. violate the referential integrity. referential integrity constraints can possibly be. violated by a modify operation. [EN891. 18.
(36) Formal Query Languages. 2.. Along with Codd's. initial. model. presentation of the relational. in 1970,. he also. proposed two formal query languages: relational algebra and relational calculus [Co70]. Before discussing the fundamental differences. shown. that they are equivalent in expressive. can be specified therefore be. in. in the. two,. should be noted that. it. has been. power [EN89][OV91]. Thus, any query. one language can also be specified. compared against. it. either of these. two. Query languages can. in the other.. determine. to. that. if. they are relationally. complete [EN89]. Relational algebra, in contrast to relational calculus,. is. more. closely related to the. underlying system instructions that perform the operations [KS86]. This. is. the primary. reason that relational algebra was chosen over relational calculus for use in this thesis.. Since the two are logically equivalent,. it is. sufficient to. implement only one. Thus,. discussion that follows, relational algebra will be discussed in. more. in the. detail than relational. calculus.. The fundamental. difference between the two languages. is. that of a procedural. language verses a nonprocedural (or declarative) language. In a procedural language, such as relational algebra, the query specifies the sequences of instructions necessary to obtain. the result. This is in contrast to nonprocedural language, such as relational calculus, specifies a query. the information. a.. by delineating what information. (i.e.,. is. the procedure to be followed).. desired rather than. how. it is. which. to obtain. [EN89][KS86]. Relational Algebra Relational algebra. is. a procedural language. Therefore,. corresponds to the operations necessary constitute relational algebra are derived. operation has as. its. to satisfy a query.. The. set. it. more. directly. of operations that. from the mathematical theory of sets [OV91]. Each. parameter(s) a relation and returns a result that. 19. is. also a relation [Da84]..
(37) Codd proposed intersection,. However,. it. eight operations in his presentation of the relational. difference,. Cartesian product,. select,. project, join,. in 1970: union,. and divide [Da84].. can be shown that of the eight only five are primitive operations:. union, difference, and Cartesian product. Select. (1). is. some combination of the. its result.. as the input parameter relation.. To. resultant relation, a selection condition (predicate). three. five primitive ones.. a unary operation, taking a relation as. yielding a subset of tuples from that relation as. schema. select, project,. [Da84][EN89][KS86][NMO90]. The other. non-primitive operations can be formed by. relational. model. its. parameter and. The resultant relation has the same. identify the tuples that are to be in the. is. specified in the select expression. on. the specified relation. All tuples in the resultant relation will satisfy the selection condition.. [EN89][KS86]. The. selection condition. is. a boolean expression consisting of clauses of. the form:. <name. of attributexcomparison operatorxconstant value>; or. <name. of attributexcomparison. where <name of attributo <comparison operator>. is. is. the. name. operatorxname of attributo. of an attribute of the input parameter relation;. either =, <, <, >, >, or. number of clauses may be connected with. the. =£;. and <constant value>. AND, OR,. and. is. any arbitrary. NOT operators. to. form the. selection condition expression [EN89].. In Figure 9, ResultRelation select operation. relation. is. the resultant relation. from performing a. on the relation Officer (Figure 7) where Unit = 3BDE. The original Officer. had 4 tuples while the resultant ResultRelation has only. can be arbitrarily complex.. 20. 2.. The. selection condition.
(38) Result Relation. Name. ££N. Unit. Rothlisberger. 123-45-6789. 3BDE. Spear. 550-34-2453. 3BDE. Figure 9 Example. (2) list to. Project. is. Result of a Select Operation. also a unary operation.. The. project operation uses an attribute. select the attributes that will appear in the resultant relation.. be a subset of the attributes of the input parameter relation in this case is not the. same. relation.. The. attribute list. The schema of. as the input parameter relation.. The. must. the resultant. attributes are a. subset of the attributes in the input parameter relation. However, the attributes in the result will be listed in the order that the attributes are listed in the attribute. resultant relation will. have the same number of. tuples.. Name. and. SSN. However, the. [EN89]. In Figure 10, ResultRelation is the resultant relation. operation of the. list.. from a projection. fields of the Officer relation (Figure 7).. The. original. Officer relation has three attribute fields while the resultant ResultRelation only has two.. However, both. relations. have the same number of. 21. tuples..
(39) ResuItRelation. (3). Name. SSN. Rothlisberger. 123-45-6789. Nash. 241-4500974. Spear. 550-34-2453. Walter. 233-45-3423. Figure 10 Example. Result of a Project Operation. Union, in contrast. to the first. two operations,. is. a binary operation.. It. along with the operations difference and Cartesian product are the standard mathematical set operations. [Da84][EN89]. Thus, the union of two relations. is. a resultant relation that. is. the set of all tuples that belong to either relation or to both. This operation, along with the. difference operation, can only be executed. compatible. That. is,. they must have the same. the corresponding attribute the. if. the. two input parameter relations are union. number of. attributes (the. must be based on the same domain (although they need not have. same name) [Da84]. As an example, two union compatible. Figure. 1. 1.. The. same degree) and. resultant relation has the. order of the attributes in the relations. is. same degree. relations are. as the input relations.. shown. Note. that the. important for checking union compatibility.. 22. in.
(40) OfficerReserve. LastName. FirstName. Ron. Spear. James. Schledorn. Leonard. Tharpe. EnlistedActive. Lname. Fname James. Justice. John. Walter. Luther. Moen. Jane. Pauli. James. Schledorn. ResultRelation last_name. first_name. Ron. Spear. James. Schledorn. Leonard. Tharpe. James. Justice. John. Walter. Luther. Moen. Jane. Pauli. Figure 11 Union Compatible. Relations and Result of Union. 23.
(41) 1. (4). resultant relation. Difference, given two input parameter relations,. which. is. comprised of. all. tuples in. A. and B, produces a. A that are not in B. As with the union. A and B must be union compatible.. operation, the input parameter relations. Therefore, the. difference of relations OfficerReserve and EnlistedActive (from Figure 11). is. shown. in. Figure 12. However, the difference of EnlistedActive and OfficerReserve would be a resultant relation that contains all of the tuples in relation EnlistedActive except for the last. tuple. which contains James Schledorn and no tuple from OfficerReserve.. OfficerEnlisted last-name. first-name. Figure 12. (5). Ron. Spear. Leonard. Tharpe. Result of Difference Operation on Relations in Figure. Cartesian Product, the last of the set operations, differs from the. previous two operations, union and difference, in two main ways.. product operator. 1. is. operating on relations. A and B. First, if the. which have 2 tuples with 3. Cartesian. attributes. and. 5 tuples with 4 attributes respectively, then the resultant relation will have 10 (2 * 5) tuples. and 7. two. (3. +. 4) attributes. In our previous. relations. would have a. example (Figure. 1. 1),. the Cartesian product of the. resultant relation with 15 (3 *5) tuples. and 4 (2 + 2). attributes.. Secondly, the two input parameters to this operation need not be union compatible.. b.. Relational Calculus. While. relational algebra. is. founded on the mathematical principles of. theory, relational calculus (a procedural language). calculus [EN89].. Two. is. well-know forms comprise the. 24. founded on. first. set. order predicate. relational calculus: tuple relational.
(42) calculus and. As. domain relational calculus. There. names imply,. their. tuples while. domain. is. a strong similarity. tuple relational calculus is the. which variables represent. in. relational calculus uses variables to represent attribute. [PCS 86]. In tuple relational calculus, the database is. domain. form. between the two forms.. relational calculus. it. is. viewed as a. set of. viewed. domain values. as a set of tuples, while in. domains. Thus, meaning. is. given to. queries by interpreting variables as assertions on the database [OV91].. Other Query Languages. 3.. SQL, QUEL, and. QBE are three commercial query languages that expand on the. formal languages previously discussed, relational algebra and relational calculus. Both. QUEL. SQL. and. QBE. are not (they lack explicit universal and existential quantifiers) [EN8 9]. In general,. are relationally complete languages, however,. they provide a higher level, definition. (a. data. definition. manipulation language is. more. some implementations of. friendly user interface along with other facilities for data. language. facilities,. function,. DML), and. considered beyond the scope of this thesis. DDL), data manipulation. [KS86].. security constraint specification to discuss these other areas.. (data. It. However, each of. these languages will be reviewed very briefly in this section to give the reader a feel for. considerations in implementing a commercial query language. All of these languages are. more. declarative than procedural.. a.. SQL The Structured Query Language, SQL,. (Structured English. QUEry Language) by many. known. SQL. 12.. of the three.. is. people and. combines constructs from both. Although, each language does not necessarily provide for. 25. still. all. is. referred. to. Sequel. probably the most well. relational algebra. of these. as. facilities.. and calculus.
(43) [EN89][KS86].. has. It. language. Queries in. The. become somewhat of. SQL can. SQL query. basic format for a <list. of attributes>. FROM. <list. of tables>. WHERE. <condition>. <list of attributes> is a list of. names. for. is:. which values are desired (corresponds. relational algebra project operation), <list of tables> to satisfy the query,. and <condition>. expression (corresponds. standard relational database. be interactive or embedded in an application [Da84].. S ELECT. where. a defacto. is. a. list. of required relations necessary. identifies the tuples desired. to the relational. to the. by evaluation of a boolean. algebra selection condition in a select operation. [EN89].. One. departure from the formal relational models. within a relation to be repeated. Thus, a relation in. SQL is. is. that. SQL. allows tuples. not a set of tuples but a multiset. (orbag)[EN89].. Some current work in the area of query languages is being done of a graphical interface for constructing queries. difficulties in. relationally. b.. forming. SQL. One such. effort attempts to. overcome the. queries (ease-of-use) by designing and implementing a. complete graphical dataflow query language (DFQL) [C191].. QUEL QUEL. has similar functionality to SQL; however, instead of combining. constructs from both of the formal languages,. it. closely parallels tuple relational calculus. [KS86]. Three types of clauses are generally used to construct most of, retrieve,. using the idea. QUEL queries:. range. and where [KS86]. Range of explicitly declares the tuple variables, retrieve. declares the attribute to retrieve (corresponds to projection attribute specifies the selection condition [EN89].. 26. list),. and where.
(44) QBE. c.. Query by Example, QBE, calculus.. It is. unique in that. it is. a. most closely related. is. to. domain. two dimensional language: skeleton tables (displaying. the relation schema) are displayed pictorially, and queries are then expressed. When. an example row(s).. looking. at a. special markings or indicators while specific database values. an underscore. To. ('_').. prefix 'P.' (for print). D.. is. relational. QBE. by. filling in. query, constant values appear without any. domain variables (which do not have. to. match any. and are completely arbitrary) are indicated by being preceded by specify that the values of a certain. used.. column. are to be retrieved, the. [EN89][KS86]. OBJECT-ORIENTED DATABASES As with. object-oriented programming, the relatively. oriented databases. (OODBMS). new. area [Ne90a] of object-. does not as yet have a formal definition/specification or. even an agreed upon informal definition/specification [Ed91][US90]. "Object-oriented databases define. =. object orientation. OODBMS s. where. the. + database. capabilities" [Kh91, p. 31] is. database capabilities. alluded to. one attempt. to. include persistence,. transactions, concurrency control, recovery, querying, versioning, integrity, security,. and. performance issues [Kh91]. This could be rewritten as object-oriented databases = objectoriented. + database. capabilities. .. This section provides a general description of discussion on several. POSTGRES. Of. 13.. OODBMSs currently. the systems looked. at,. available:. only. IDB. OODBMS. concepts along with a. IDB, Ontos, Vbase, Gemstone, and. will be given. more than a cursory look. [Kh91] defines object orientation as abstract data types + inheritance + object. essentially the. discussion of. same. definition previously used in this paper for object-oriented.. OODBMS concepts see [US90].. 27. identity,. which. is. For a more in-depth.
(45) since. is. it. system used. the. Management System. implement the Relational/Object-Oriented Database. to. in this thesis.. Object-Oriented Model Concepts. 1.. The most well known data modeling model model. Until the conventional. late 1970s, this. DBMSs. model was. and relational systems) that meet traditional. business data processing requirements [EN89].. The ER. used prior to actually developing a database schema. To meet. the needs for. (ER) data. modeling needs of. sufficient for supporting the. (hierarchical, network,. needs have become more complex, the. the Entity-Relationship. is. data. model. in a specific. is. a high-level. DBMS. As. model. modeling. ER data model has become increasingly inadequate.. complex data models, many data models have been proposed. Of. those proposed, they generally. fall into three categories:. semantic data models. ,. functional. data models, and object-oriented models [EN89]. In conventional. model. Here data. is. DBMSs,. looked. at as a. a group of tuples (or records). be converted into a. any. real. of an. world. ER. DBMS. data. is. modeled using the. which. specific. are all stored in a file [EN89]. Thus, the. model. (or. schema) which. may. conversion process.. for a relational database application. which. is. lose. its. ER model must resemblance to. A good example is that. converted to a group of. relations that are then normalized. In the normalization process, the original. distorted to such an extent that. any relationship. represented in the database application. is lost. to the original real. as information. is. world. scattered. model may be entities. among. being. relations. [EN89].. 14.. ER. group of relations (or record types) that are comprised of. entities (or objects) during the. model. classical record-oriented. [EN89] provides an detailed discussion of what they term the enhanced-ER model (EER) which. encompasses what they consider the most important concepts of the semantic data model.. 28.
(46) Of. the. models mentioned above, we focus on the object-oriented data model.. With an object-oriented model, a database world. [EN89]. In. entities. [EN89]. Thus, there. is. OODBMSs,. is. considered group of objects that represent real. objects are represented directly by database objects. ER model;. no loss of the original model as with the. real-world entities are modeled using complex objects, there. between a real-world allows objects identified. to. and. entity. its. more complex. a direct correspondence. database representation. This direct correspondence. maintain their integrity and identity which in turn allows the objects to be. and operated upon [EN89]. Some have gone so. meaningful. is. as. to talk. far as to question. whether. it is. about an object-oriented data model [Ki90] since object-oriented data. model concepts and. the object-oriented. paradigm are for. all. practical purposes the same.. Fundamental object-oriented data model concepts include data abstraction, encapsulation, object identity [Mc91j, inheritance,. complex. objects,. message passing, and. operator overloading (or polymorphism) [Ki90]. All of these concepts, with the exception. of object identity, were specifically addressed previously in this chapter under objectoriented. programming concepts. Generally, each object. identifier that is. which allows. 2.. system generated. The. attributes to be. represented by an object. independent from any key attributes. modified without destroying the objects identity. [EN89]. Object-Oriented Database Systems Persistence of objects. OODBMSs. is. considered the primary difference between. [EN891. Objects used in an. execution whereas those in. provided by the. advantages as those of. OOPL. program. OOPLs. exist only during. OODBMSs must exist permanently in secondary. session to session. Thus, the facilities. identifier is. is. and. program. storage from. OODBMSs and OOPLs are quite similar except for additional. OODBMS. OOPLs:. system.. By. the. same token,. expressibility, reusability, etc.. 29. OODBMSs have. similar.
(47) "The Object-Oriented Database System Manifesto" 15 written. in. 1989 by M.. Atkinson, F. Bancilhon, D. DeWitt, K. Kittrick, D. Maier, and S. Zdonik for the First International Conference. on Deductive and Object-oriented Databases, Kyoto, Japan,. describes 13 mandatory characteristics, listed in Figure 13, for a database system to be. considered an. OODBMS. [Ed91].. 1.. supports complex objects. 2.. supports object identity. 3.. encapsulates objects. 4.. supports either types or classes. 5. classes. or types inherit from their ancestors. 6.. do not bind prematurely. 7.. are computationally complete. 8.. are extensible. 9.. data. is. persistent. 10.. manages very large databases. 11.. allow concurrent users. 12.. recover from software and hardware failures. 13.. have a simple way to query data. Figure 13. 15.. OODBMS. Manifesto. This does not contain an agreed upon set of characteristics, rather,. acteristics for. agreement within the database community.. 30. it is. an attempt. to offer char-.
(48) There are some correlations. how some. that help to conceptualize. relational paradigm.. A. The. relation. set of. rows of a. have no correlation inheritance,. to. that. row. be made between. RDBMS and OODBMSs. of the object-oriented paradigm relates to the. may be. in a relation. may. may. thought of as an object in an. be equated to a. class.. Other concepts in. OODBMS.. OODBMSs that. anything in a relational system include: methods, object identifiers,. and encapsulation. However,. OODBMSs. do not have a mathematical. foundation to stand on as relational systems do. [Ed91]. IDB Object Database Overview. 3.. a.. General Information. IDB [Pe91a][Pe91b][Pe91c][Pe91d] commercial market for over a. in. 1990 However, .. it. is. a. new. OODBMS that first entered the. could be considered to have been in development. decade with the design and architecture of the Interface Description Language. (DDL), a subset of which. is. a fundamental. component of. the. IDB. system.. from the ground up as an object database management system. This other database. management systems. object-oriented systems. relational. Some. that. fall. built. contrast to. some. claim to be object-oriented but are not. 'real'. is in. of these are systems that have as their kernel or core a. system that has object-oriented extensions added on. object-oriented but. IDB was. top.. Others claim to be. short in fully implementing the concepts that comprise the object-. oriented paradigm: inheritance, encapsulation, polymorphism, and abstract data types.. The. current version of. Domain OS (680X0), Sun this list to include the. 3 (680X0),. Macintosh,. differences between the version. IDB Sun. is. 1.1.. Version 1.0 ran on several platforms:. SPARC and Windows 3.x.. schema without having. to. 1.1. extends. NeXT, and HP-UX (680X0 and PA-RISC). Other key 1.0. and. 1.1. include:. networked together can now share data over the network; a. Version. modify the ASCII form. 31. file;. supported platforms that are attributes. may be removed from. ease of access to. menu. facilities.
(49) has increased; development tools. removed. may. be used with. Windows. 3;. and bugs have been. that existed in version 1.0. [Pe91b]. Persistent. Data Systems, the designer and developer of IDB, describe IDB as. "an object database for software developers. complex shared data"[Pe91d,. p. 3].. who. build applications that. IDB. Applications suited for use with. must manage. include. CASE,. CAD, image management systems, hypertext systems, hypermedia systems and geographic information systems. This. list is. not intended to be. all. inclusive, but rather to give the reader. an idea of the types of applications with requirements to model, manage, and store complex. and unconventional data. [Pe91d]. The data and Ritchie (K&R). definition language (or. C. [KR78]. schema language), IDL, extends Kernighan. to include object-oriented capabilities.. multiple inheritance, and dynamic binding and loading are. Because IDB uses. among. Polymorphism,. these capabilities.. K&R C, tools available for working with C (such as the C compiler and. on-line debugger) on each supported platform. may be used. in the. development of IDB. applications. [Pe91d]. IDL facilitates. the interface between. C and IDB. The interface can be thought. of as consisting of three parts: core interface, display manager interface, and browser interface.. The core. interface allows. IDB. applications to have object-oriented capabilities.. Display management for stand alone applications uses the display manager interface. This interface. is. not exclusive to stand alone applications since. its. features can also be accessed. from within the browser. The browser interface has the features of the display manager interface in addition to other special features only available in the browser. [Pe91d]. b.. Clusters and Structures. A logical. key concept. in. and physical sense. That. IDB is,. is. that of a 'cluster'. This. the term cluster. 32. when used. term. in the. is. used. in. both the. context of computer.
(50) science generally brings to strict. mind. clustering in. memory. However,. sense means to gather things together. In IDB, a cluster. group of objects. user system,. it. An object cannot be in more than one cluster.. "The. cluster in the. a gathering of objects or a. Since. IDB. is built as. cluster is the unit of data transfer. locking for control of concurrent access" [Pe91d,. a multi-. connected by references" [Pe91c, simply a. set. Since a cluster. p. 6].. and the unit of. p. 3].. Systems describes an IDB database as "a. Persistent Data. is. word. also includes facilities for concurrent access control. Clusters are important. in maintaining the access control.. database. is. the. is. set of objects. a group of objects, then an. IDB. of clusters connected by references. There are two kinds of. references in IDB: local references and cross references. descriptive. Local references are those references. The names themselves. are quite. between objects of the same. Cross references, on the other hand, are between objects belonging. cluster.. to different clusters.. [Pe91d]. Access time that the cluster are. made by. pointers. if. IDB. is. is. still. also. open on. not in main. also use. that cluster).. The. memory. This case. is. already present in. memory. other possibility is. is. that the object being. resolved by using unique identifiers. guarantees that every object created will have a unique identifier. This. identifier is not only. is,. may. issues to every object. [Pe91d]. IDB. That. It is at this. read in from secondary storage into main memory. Local references. the cluster containing the object they reference. cross referenced that. is. gained by opening a transaction on the cluster.. using pointers to the object being referenced. Cross references. a transaction. (i.e.,. to clusters is. unique to the. an object created by. cluster, system, platform, etc.;. IDB on any platform can be. be guaranteed that the identifier. together to share. IDB. files. is. it is. unique universally.. ported to any other platform and. unique. This allows different platforms networked. without object identification problems. Thus, "no two objects. 33.
(51) have the same identity and an object will maintain. will ever. from place. cluster identifiers (CID), object identifiers (OID),. unique. installation, a. to. even when moved. to place" [Pe91d, p. 4].. Several identifiers are needed to accomplish. MID is. set. up that. is. form the CID.. Finally, the. OID. is. this:. and local. master identifiers (MID), identifiers (LID).. assigned to each copy of. When a cluster is created, the MID. Systems.. identity. its. is. combined with. composed of. Persistent Data. further numerical identifiers. CID and. the. IDB by. During. the. LID which. uniquely. identifies the object within the cluster. [Pe91d]. Each structure.. The. cluster is described. by an Interface Description Language (IDL). structure contains all the necessary types to describe the objects of a cluster.. In other words,. it. really the "description of structural constraints. IDL model attribute. is. graph. given in Figure. A directed set of attributes.. The. [NMSW83, p.. on data". predicated upon the directed attribute graph. is. The IDL. contains the schema for the cluster specified in IDL.. attribute. 7].. structure is. The fundamental. An example. of a directed. 14.. graph. is. composed of. The type of a node determines. a set of typed nodes that possess a. the particular set of attributes. attributes are either a primitive value (the value is. embedded. in the. it. will contain.. node and. is either. boolean, integer, or rational) or a node-value (a pointer to another node). In Figure 14, the attributes with node-values to other nodes.. have pointers which are the directed edges. Each graph must have a root node. by following some path along different. attribute. that allows all other. edges from the root. structure specifies a related class of attributed directed graphs types, the attributes of each. node type, and the type of the root". 34. in the. by. graph pointing. nodes. to. be reached. to the nodes.. "An IDL. listing the set of. [NMSW83,. p. 7].. node.
(52) root. >. inner. left. ut ngnt. op level. = 2. depth. = 1. r. mult. ' >. inner. leaf. left. val. =. 7. right. level. =. op. depth =. level. =. 1. 1. depth =. 1. plus. leaf. leaf. val. =2. level. depth. =. 3. level. =. depth = 2. =2. Figure 14 An Example of a. c.. =. val. Directed Attribute Graph. [NMSW83, p.. Nodes, References and Attributes. Every IDB object must have a type and can only be that. an object. may have. cluster schema. In objects.. 8]. in. one. are defined through the class structure that. is. cluster.. The types. delineated in the. IDB, only classes which have no subclasses can be instantiated as. These classes are called nodes and have the type node. the nodes are the leaves of the class structure. This. is. type. In the class hierarchy,. something of a departure from the. standard object-oriented concept of a class since only leaf classes can be instantiated.. 35.
(53) However, any. class that. is. made. not a leaf can always be. a leaf (in a logical. instantiating a subclass of the class to only inherit all attributes. superclass. That. is, it is. a leaf. which. is. a copy of. its. way) by. and methods of. its. superclass except that the superclass. has subclasses and the leaf (by definition) does not. Other class types that are not node types are said to be strict class types.. Consider the graph presented in Figure. IDL schema clear. are. (included as. from the graph. IDB node. APPENDIX A). that the leaf. may be. types and. from. nodes are. the. 15,. IDB. strict class. User's Manual [Pe91d,. ptrain, ftrain, fplane,. instantiated to. IDB. objects.. build the attributes and methods of the node types but. These. which is derived from the example. may. and pplane. These classes. The other. example, ptrain inherits. IDB all. classes are used to. not be instantiated into objects.. types delineate attributes and methods that are. descendants [New86].. p. 32]. It is. common. to all of their. also supports the idea of multiple inheritance. Thus, in our. of the attributes and methods of class types passenger and. train.. vehicle. '. freight. N.. train. plane. \ ptrain. likens the. languages[New86]. Record. /\ fplane. ftrain. Figure 15 A. Newcomer. passenger. n.. 1. / pplane. Class Hierarchy. IDL node. type to the idea of a record type in other. fields are similar to a. node's attributes[New86]. There are two. kinds of references which connect objects: local references and cross references. All. 36.
(54) references must also have a type; however, unlike objects which can only have node types, references can have the type of any class in the cluster. point to any class of that type or any of. its. descendants. A references. of a certain type can. the class. not a node). Thus, a. (if. is. reference of type train, in Figure 15 above, could point to a train, a ptrain, or a ftrain.. From. the root reference of any cluster, all objects within that cluster. reachable by following attributes. some path along. that reference. the. same. references in the cluster.. object.. In. this. Two. way, references. objects. must be. may have. facilitate. sharing.. References are also allowed to create cycles within a cluster.. There. is. another possibility for the type of a reference: universal types.. types discussed up to this point have. all. been associated with a particular. types allow references to refer to an object in any cluster. relation to each other is. shown. cluster.. Universal. The universal types and. in Figure 16. [Pe91c]. idl. univ. idl_any. idl_univ_seq. idl_univ_array. any. any. any. (cluster_l). (cluster_2). (cluster_n). Figure 16. idl. Universal Types [Pe91c,. 37. univ link. p. 36]. The. string. their.
(55) d.. Transactions. IDB. Since. is. a multi-user system, concurrency control. must be maintained.. Transactions are used to implement concurrent access control to clusters. Additionally, transactions guarantee that cluster updates are. all. or nothing. That. is,. the entire cluster. is. updated or nothing in the cluster gets updated. Thus, cluster modifications are 'atomic'. [Pe91c][Pe91d] Transactions allow users to read and write clusters. Access to a cluster. determined by one of four types of transactions: write, create, read, and examine.. modify an. object, a write transaction. write transactions.. An. arbitrary. To. must be open. Examine and read transactions allow by one or more. different forms of parallel access to a cluster. created by the create transaction.. is. user.. New. cluster values are. A series of 'roll-back' points may be established by nested number of. write transactions. complex modifications. create or write transactions. Large and. may. be nested within other. are facilitated in this manner.. [Pe91d]. Reading and traversal of cluster objects and the and. their associated attributes to set values of. transactions.. While a read transaction. is. browser variables. open on a. that cluster is allowed. Similarly, only while. ability to use those objects. cluster,. is. possible during read. no write or create transaction on. no write or create transaction. read transaction be opened. This guarantees that the cluster being viewed in. same. as that cluster. open,. memory. may is. a. the. on secondary storage.. Examine stop a write transaction cluster being. is. viewed. transactions are similar to read transactions except that. from being opened and/or committed on the same. in. memory may. storage. This transaction can be. it. cluster.. does not Thus, the. be different (older) than that cluster on secondary. opened. at. any time.. 38. It. allows a greater amount of.
Related documents
We extracted raw data of numbers of people diagnosed with dementia in the respective bilingual and non-bilingual groups and combined unadjusted odds ratios from included studies,
The use of the emergency released vapor (0.2MPa/120ºC) can generate an emergency 2Mwe.. The production cost of the nuclear electricity. In calculating the reduced costs of production
In terms of employer , it was only for persons with jobs in the public sector that there was a significant difference between the FC and SC average synthetic monthly wage (Table
These mood symptoms primarily were irritability, ner- vousness, and frequent mood changes, but not feeling “blue.” 11 A recent study by Freeman and colleagues 8 and a follow-up study
Mô phỏng phương trình theo định hướng không có chương trình khởi tạo tương tự mà phát sinh một cách tự nhiên từ cấu trúc flowsheet và có thể được xem xét để khởi
Enter the IP source address for Cisco IOS Telephony Services :10.90.0.1 Enter the Skinny Port for Cisco IOS Telephony Services : [2000]:2000 How many IP phones do you want to
[r]
If its first argument is nonfresh, then the second cond line of walk ∗ must