ISG STAFF WORKING PAPERS Objects in the Database
Total Page:16
File Type:pdf, Size:1020Kb
soG ISG STAFF WORKING PAPERS Public Disclosure Authorized Public Disclosure Authorized Public Disclosure Authorized Objects in the Database: A Reality Check Parvez Bashir Information Public Disclosure Authorized Officer, ISGEC IFl - I Sol Grion ISG STAFF WORKING PAPERS ISG Staff Working Papers are reviewed by the VP-CIO and by the ISG Senior Management Team. Papers are evaluated and the best of the papers will be recognized. The series is envisioned to be forward-looking and cover a broad range of topics. Over a period of time, the papers will be compiled and published as a book. ffMy= .I Parvez Bashir Information Officer, ISGEC Objects in the Database: A Reality Check The RDBMS (Relational Database Management System) ruled the database roost in the 1980s and 00 (Object Oriented) programming languages revolutionized software development in the 1990s. RDBMSs and 00 programming languages have complementary strengths. Relational database systems are good for managing large amounts of data; object oriented programming languages are good at expressing complex relationships among objects. Relational database systems are good for data retrieval but provide little support for data manipulation; object oriented programming languages are excellent at data manipulation but provide little or no support for data persistence and retrieval. These complementary strengths have given birth to a new breed of database management systems popularly known as Object Relational Database Management Systems (ORDBMS). The other database model which deals purely with objects is the ODBMS (Object Database Management System). ODBMSs pre-date the object relational model and have been in use since time immemorial in niche applications including multimedia. This paper mainly focuses on database object concepts, specifications, and implementations using the two core models introduced above. Given the mountain of information on DB object orientation, the author has attempted to cut through hype and superficial information in order to arrive at a precise JEI (just enough info) treatment of 00 implementation in database. Factual information in this paper has been drawn from various sources. * The first section of the paper introduces both the object model and object database model concepts. * In the second section, the ODMG 2.0 object database standard is discussed followed by a skeleton ODMG 2.0 specification and an implementation example using the Jasmine ODBMS. This section also covers desired ORDBMS features, and introduces a skeleton SQL-99 specification followed by implementation examples in Infonrix and Orack 8i. * The third section uncovers the basic concepts of the ORDBMS extensibility system, compares ORDBMS extended model implementations by IBM/Informix/Oracle, and provides an extended or specialized implementation example using the Oracle 8i extensibility type system. • The fourth and final section provides some thoughts on database object implementation applicability in various application areas in an enterprise followed by guidelines on evaluating Object Relational Database Management Systems. -i- Table of Contents 1. BASIC OBJECT CONCEPTS ............................................. I 1.1 The Object Model ........................................................ 1 Encapsulation ........................................................ 1 Inheritance ........................................................ 2 Polymorphism ....................................................... 2 Object Identity, References among Objects, and Collections ......................... 3 1.2 The Object Database Model ........................ ................................ 4 Encapsulation ....................................................... 4 Inheritance ........................................................ 4 Polymorphism ....................................................... 4 Object Identity ........................................................ 4 References among Objects ................ ....................................... 4 Storing Objects ....................................................... 4 Changing Objects ....................................................... 4 Deleting Objects ....................................................... 4 Queries ....................................................... 4 2. DATABASE OBJECT SPECIFICATIONS ..................................................... 5 2.1 ODBMS DATABASE OBJECT SPECIEICATION ................................ 5 2.1.1 ODBMS Object Features [ODMG 2.0] .................................................. 5 2.1.2 Core ODBMS Object Specification [ODMG 2.0] ................ ................. 5 Object Definition Language (ODL) ............................................... 6........6 Object Query Language (OQL) ........................................................ 7 OQL Basic Notation ........................................................ 8 OQL Expressions ........................................................ 8 OQL Expressions (Continued) .............................. .......................... 9 OQL Examples ........................................................ 9 2.1.3 ODMG ODBMS IMPLEMENTATION EXAMPLE: JASMINE ...... 10 Jasmine ODQL Persistent Class Family Construction .................................. 10 Jasmine ODQL Database Object Creation .................................................... 11 Jasmine ODQL Object Queries ....................................................... 12 2.2 ORDBMS DATABASE OBJECT SPECIFICATION ........................... 12 2.2.1 ORDBMS Object features [Michael Stonebraker] ............................... 12 Base Type Extension ....................................................... 13 Dynamic Linking ....................................................... 13 Client or Server Activation ....................................................... 13 Security ....................................................... 13 Callback ....................................................... 13 User Defined Access Methods ..................................... .................. 13 Arbitrary length Data Types ....................................................... 13 Complex Types ....................................................... 13 Inheritance ....................................................... 13 iii - Inheritance ...................................................... 13 Overloading ...................................................... 13 Inheritance of Types ...................................................... 13 Multiple Inheritance ...................................................... 13 2.2.2 Core ORDBMS Object Specification [SQL-99] .................................. 13 User-Defined Types ...................................................... 14 Reference Types ...................................................... 17 dereference operation ...................................................... 18 reference resolution ...................................................... 18 Row Types ...................................................... 18 Collection Types ...................................................... 18 Distinct Types ...................................................... 19 Object Orientation and SQL-99 ...................................................... 19 Classes ...................................................... 19 Encapsulation ...................................................... 19 Extensibility ...................................................... 19 Inheritance ...................................................... 19 Instantiation ...................................................... 19 Polymorphism ...................................................... 19 2.2.3 SQL-99 ORDBMS IMPLEMENTATION EXAMPLES: INFORMIX AND ORACLE 8i .......................................................... 20 INFORMIX .......................................................... 20 ORACLE8i .......................................................... 21 3. ORDBMS EXTENSIBILITY ARCHITECTURE .......................................... 23 3.1 EXTENSIBILITY BASICS .......................................................... 23 3.1.1 An Extensible Data Management Architecture .................................... 23 The Universal Server Approach .......................................................... 23 The Middleware Approach .......................................................... 23 The Object Layer Approach .......................................................... 24 3.1.2 Universal Server (ORDBMS) Extensibility Features .......................... 24 Extensible Type System .......................................................... 24 User-Defined Functions .......................................................... 24 Index Structures .......................................................... 24 Optimizer.......................................................... 24 Other Extensions .......................................................... 25 3.2 SQL-99 SUPPORT FOR THE EXTENSIBLE ORDBMS .................... 25 3.3 ORDBMS EXTENSIBILITY IMPLEMENTATIONS ......................... 25 3.3.1 DB2 Relational Extenders .......................................................... 25 3.3.2 Informix Datablades .......................................................... 26 3.3.3 Oracle Extensibility Architecture [Cartridges] .................................... 27 3.3.4 Extensibility Features Comparison Matrix: Major ORDBMS Vendors .......................................................................................................................28