Top Banner

Click here to load reader

1 Chapter 26 Object-Oriented DBMSs – Concepts and Design Transparencies © Pearson Education Limited 1995, 2005

Dec 14, 2015

ReportDownload

Documents

  • Slide 1

1 Chapter 26 Object-Oriented DBMSs Concepts and Design Transparencies Pearson Education Limited 1995, 2005 Slide 2 2 Chapter 26 - Objectives u Framework for an OODM. u Basics of the FDM. u Basics of persistent programming languages. u Main points of OODBMS Manifesto. u Main strategies for developing an OODBMS. u Single-level v. two-level storage models. u Pointer swizzling. u How an OODBMS accesses records. u Persistent schemes. Pearson Education Limited 1995, 2005 Slide 3 3 Chapter 26 - Objectives u Advantages and disadvantages of orthogonal persistence. u Issues underlying OODBMSs. u Advantages and disadvantages of OODBMSs. Pearson Education Limited 1995, 2005 Slide 4 4 Object-Oriented Data Model No one agreed object data model. One definition: Object-Oriented Data Model (OODM) Data model that captures semantics of objects supported in object-oriented programming. Object-Oriented Database (OODB) Persistent and sharable collection of objects defined by an ODM. Object-Oriented DBMS (OODBMS) Manager of an ODB. Pearson Education Limited 1995, 2005 Slide 5 5 Object-Oriented Data Model u Zdonik and Maier present a threshold model that an OODBMS must, at a minimum, satisfy: It must provide database functionality. It must support object identity. It must provide encapsulation. It must support objects with complex state. Pearson Education Limited 1995, 2005 Slide 6 6 Object-Oriented Data Model u Khoshafian and Abnous define OODBMS as: OO = ADTs + Inheritance + Object identity OODBMS = OO + Database capabilities. u Parsaye et al. gives: High-level query language with query optimization. Support for persistence, atomic transactions: concurrency and recovery control. Support for complex object storage, indexes, and access methods. OODBMS = OO system + (1), (2), and (3). Pearson Education Limited 1995, 2005 Slide 7 7 Commercial OODBMSs u GemStone from Gemstone Systems Inc., u Objectivity/DB from Objectivity Inc., u ObjectStore from Progress Software Corp., u Ontos from Ontos Inc., u FastObjects from Poet Software Corp., u Jasmine from Computer Associates/Fujitsu, u Versant from Versant Corp. Pearson Education Limited 1995, 2005 Slide 8 8 Origins of the Object-Oriented Data Model Pearson Education Limited 1995, 2005 Slide 9 9 Functional Data Model (FDM) u Interesting because it shares certain ideas with object approach including object identity, inheritance, overloading, and navigational access. u In FDM, any data retrieval task can viewed as process of evaluating and returning result of a function with zero, one, or more arguments. u Resulting data model is conceptually simple but very expressive. u In the FDM, the main modeling primitives are entities and functional relationships. Pearson Education Limited 1995, 2005 Slide 10 10 FDM - Entities u Decomposed into (abstract) entity types and printable entity types. u Entity types correspond to classes of real world objects and declared as functions with 0 arguments that return type ENTITY. u For example: Staff() ENTITY PropertyForRent() ENTITY. Pearson Education Limited 1995, 2005 Slide 11 11 FDM Printable Entity Types and Attributes u Printable entity types are analogous to base types in a programming language. u Include: INTEGER, CHARACTER, STRING, REAL, and DATE. u An attribute is a functional relationship, taking the entity type as an argument and returning a printable entity type. u For example: staffNo(Staff) STRING sex(Staff) CHAR salary(Staff) REAL Pearson Education Limited 1995, 2005 Slide 12 12 FDM Composite Attributes Name() ENTITY Name(Staff) NAME fName(Name) STRING lName(Name) STRING Pearson Education Limited 1995, 2005 Slide 13 13 FDM Relationships u Functions with arguments also model relationships between entity types. u Thus, FDM makes no distinction between attributes and relationships. u Each relationship may have an inverse relationship defined. u For example: Manages(Staff) PropertyForRent ManagedBy(PropertyForRent) Staff INVERSE OF Manages Pearson Education Limited 1995, 2005 Slide 14 14 FDM Relationships u Can also model *:* relationships: Views(Client) PropertyForRent ViewedBy(PropertyForRent) Client INVERSE OF Views u and attributes on relationships: viewDate(Client, PropertyForRent) DATE Pearson Education Limited 1995, 2005 Slide 15 15 FDM Inheritance and Path Expressions u Inheritance supported through entity types. u Principle of substitutability also supported. Staff() ENTITY Supervisor() ENTITY IS-A-STAFF(Supervisor) Staff u Derived functions can be defined from composition of multiple functions (note overloading): fName(Staff) fName(Name(Staff)) fName(Supervisor) fName(IS-A-STAFF(Supervisor)) u Composition is a path expression (cf. dot notation): Supervisor.IS-A-STAFF.Name.fname Pearson Education Limited 1995, 2005 Slide 16 16 FDM Declaration of FDM Schema Pearson Education Limited 1995, 2005 Slide 17 17 FDM Diagrammatic Representation of Schema Pearson Education Limited 1995, 2005 Slide 18 18 FDM Functional Query Languages u Path expressions also used within a functional query. u For example: RETRIEVE lName(Name(ViewedBy(Manages(Staff)))) WHERE staffNo(Staff) = SG14 u or in dot notation: RETRIEVE Staff.Manages.ViewedBy.Name.lName WHERE Staff.staffNo = SG14 Pearson Education Limited 1995, 2005 Slide 19 19 FDM Advantages u Support for some object-oriented concepts. u Support for referential integrity. u Irreducibility. u Easy extensibility. u Suitability for schema integration. u Declarative query language. Pearson Education Limited 1995, 2005 Slide 20 20 Persistent Programming Languages (PPLs) Language that provides users with ability to (transparently) preserve data across successive executions of a program, and even allows such data to be used by many different programs. u In contrast, database programming language (e.g. SQL) differs by its incorporation of features beyond persistence, such as transaction management, concurrency control, and recovery. Pearson Education Limited 1995, 2005 Slide 21 21 Persistent Programming Languages (PPLs) u PPLs eliminate impedance mismatch by extending programming language with database capabilities. In PPL, languages type system provides data model, containing rich structuring mechanisms. u In some PPLs procedures are first class objects and are treated like any other object in language. Procedures are assignable, may be result of expressions, other procedures or blocks, and may be elements of constructor types. Procedures can be used to implement ADTs. Pearson Education Limited 1995, 2005 Slide 22 22 Persistent Programming Languages (PPLs) u PPL also maintains same data representation in memory as in persistent store. Overcomes difficulty and overhead of mapping between the two representations. u Addition of (transparent) persistence into a PPL is important enhancement to IDE, and integration of two paradigms provides more functionality and semantics. Pearson Education Limited 1995, 2005 Slide 23 23 OODBMS Manifesto u Complex objects must be supported. u Object identity must be supported. u Encapsulation must be supported. u Types or Classes must be supported. u Types or Classes must be able to inherit from their ancestors. u Dynamic binding must be supported. u The DML must be computationally complete. Pearson Education Limited 1995, 2005 Slide 24 24 OODBMS Manifesto u The set of data types must be extensible. u Data persistence must be provided. u The DBMS must be capable of managing very large databases. u The DBMS must support concurrent users. u DBMS must be able to recover from hardware/software failures. u DBMS must provide a simple way of querying data. Pearson Education Limited 1995, 2005 Slide 25 25 OODBMS Manifesto u The manifesto proposes the following optional features: Multiple inheritance, type checking and type inferencing, distribution across a network, design transactions and versions. u No direct mention of support for security, integrity, views or even a declarative query language. Pearson Education Limited 1995, 2005 Slide 26 26 Alternative Strategies for Developing an OODBMS u Extend existing object-oriented programming language. GemStone extended Smalltalk. u Provide extensible OODBMS library. Approach taken by Ontos, Versant, and ObjectStore. u Embed OODB language constructs in a conventional host language. Approach taken by O 2,which has extensions for C. Pearson Education Limited 1995, 2005 Slide 27 27 Alternative Strategies for Developing an OODBMS u Extend existing database language with object- oriented capabilities. Approach being pursued by RDBMS and OODBMS vendors. Ontos and Versant provide a version of OSQL. u Develop a novel database data model/language. Pearson Education Limited 1995, 2005 Slide 28 28 Single-Level v. Two-Level Storage Model u Traditional programming languages lack built-in support for many database features. u Increasing number of applications now require functionality from both database systems and programming languages. u Such applications need to store and retrieve large amounts of shared, structured data. Pearson Education Limited 1995, 2005 Slide 29 29 Single-Level v. Two-Level Storage Model u With a traditional DBMS, programmer has to: Decide when to read and update objects. Write code to translate between applications object model and the data model of the DBMS. Perform additional type-checking when object is read back from database, to guarantee object will conform to its original type. Pearson Education Limited 1995, 2005 Slide 30 30 Single-Level v. Two-Level Storage Model u Difficulties occur because conventional DBMSs have two-level storage model: storage model in memory, and database storage model on disk. u In contrast, OODBMS gives illusion of single- level storage model, with similar representation in both memory and in database stored on disk. Requires clever management of representation of objects in memory and on disk (ca

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.