1 / 43

Chapter 11

Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel In this chapter, you will learn: What basic concepts govern OO systems What effect OO concepts are likely to have on data modeling and design

RoyLauris
Download Presentation

Chapter 11

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel

  2. In this chapter, you will learn: • What basic concepts govern OO systems • What effect OO concepts are likely to have on data modeling and design • How OO features are related to the more traditional relational and E-R models • What the basic features of an OO database management system (OODBMS) are • About the advantages and disadvantages of OODBMSs Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  3. Object Orientation • Object Orientation • Set of design and development principles • Based on autonomous computer structures known as objects • OO Contribution areas • Programming Languages • Graphical User Interfaces • Databases • Design • Operating Systems Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  4. Evolution of OO Concepts • Concepts stem from object-oriented programming languages (OOPLs) • Ada, ALGOL, LISP, SIMULA • OOPLs goals • Easy-to-use development environment • Powerful modeling tools for development • Decrease in development time • Make reusable code • OO Attributes • Data set not passive • Data and procedures bound together • Objects can act on self Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  5. OO Concepts: Objects • Abstract representation of a real-world entity • Unique identity • Embedded properties • Ability to interact with other objects and self • OID • Unique to object • Not a primary key • Automatically assigned • Cannot be altered • Cannot be reused Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  6. Attributes • Called instance variables in OO • Domain • Object state • Object values at any given time *References to more than one object Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  7. OO Concepts: Objects (con’t.) • Methods • Code that performs operation on object’s data • Has name and body • Body contains instructions in programming language • Protect data from direct and unauthorized access • Used to update data and retrieve results • Equivalent to procedures in procedural languages • Messages • Invokes method (by sending messages to them) • Specifying receiver object, name of the method and parameters • Object may send message to another object Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  8. OO Concepts: Objects (con’t.) • Classes • Collection of similar objects • Shares attributes and structure Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  9. Class-Example Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  10. Protocol • Collection of class’s messages • Represents object’s public aspect (how object is known to other objects and to the user) • In contrast, method implementation and data are private aspects Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  11. Object Characteristics Figure 11.7 Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  12. Class Hierarchy • Superclass • Subclass • Class lattice (if class can have multiple parents) Figure 11.8 Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  13. Inheritance • Ability of object to inherit the data structure and behavior of classes above it • We do not need to redefine data and methods for a subclass • Type I: Single inheritance • Class has one immediate superclass Figure 11.9 Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  14. Inheritance (con’t.) • Type II: Multiple • Class has more than one immediate superclass Figure 11.10 Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  15. Problem with multiple inheritance • What property to inherit? Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  16. Method Overriding • Method redefined at subclass level • Allows objects to behave according to specific characteristics Figure 11.12 Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  17. Polymorphism • Allows different objects to respond to same message in different ways • Class automatically detected Figure 11.13 Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  18. Abstract Data Types (ADT) • Describes a set of similar objects • (like Real, integer… in classic programming) • Differs from conventional data types • Operations are user-defined • Uses encapsulation (data cannot be acessed directly) • Definitions needed for creation • Name • Data representation (I.e. value) • Abstract data type operations and constraints • Can be implemented through methods • E.g. we may define records, etc… as abstract data types Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  19. Object Classification • Simple • Only single-valued attributes • No attributes refer to other object • Composite • At least one multivalued attribute • No attributes refer to other object • MOVIE object with multivalued movie attribute • Compound • At least one attribute that references other object • E.g. STUDENT with attribute advisor referencing object PROFESSOR from other class • Hybrid • Repeating group of attributes • At least one refers to other object Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  20. Characteristics of Object Oriented Data Model • Supports complex objects • Not just records, but multimedia, protein chains • Must be extensible • Defining new data types and operations on them • Supports encapsulation • Data representation and method implementation hidden from outside • Exhibit inheritance • Object must be able to inherit properties from other objects • Supports object identity • OID Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  21. OO vs. E-R Model Components Table 11.3 Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  22. Graphical Representation of Objects Figure 11.14 OID State of object instance Figure 11.15 Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  23. Use of Abstract Data Types (ADT) Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  24. Object Space – Object Schema • Used to represent the state of an object at a given time • OID used to refer to other objects Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  25. Referential Sharing of Objects Figure 11.19 Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  26. Class-Subclass Relationship Figure 11.21 Figure 11.20 • Employee “IS” a person Related only to employee Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  27. Interobject Relationships • Attribute-Class Link • Object’s attribute references another object (from same or different class) Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  28. Relationship Representation • Analog to ER diagrams • Related classes enclosed in boxes • Double line on right side indicates mandatory • Connectivity indicated by labeling each box • 1:M • M:N • M:N with an Intersection Class Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  29. 1:1 and 1:M Relationships Descriptive name Of characteristics We want to model Mandatory Unlike in relational model, facility is included within employee and vice versa Figure 11.24 Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  30. Employee-Dependent Relationship Figure 11.25 Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  31. Representing the M:N Relationship Figure 11.26 Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  32. Representing the M:N Relationship with Associated Attributes Attributes of relationship Logical unit (accompanied by) Figure 11.27 Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  33. Representing the M:N Relationship with Intersection Class Analog to composite entity Figure 11.28 Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  34. Object Space Representation Figure 11.29 Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  35. Late and Early Binding • Late binding • Data type of attribute not known until runtime • Allows different instances of same class to contain different data types for same attribute Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  36. Late and Early Binding (cont) • Early binding • Allows database to check data type at compilation or definition time Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  37. OODM vs. E-R Data Models • Object, vs. Entity, and Tuple • OODM object has behavior, inheritance, and encapsulation • OO modeling more natural • Class, vs. Entity Set, and Table • Class allows description of data and behavior • Class allows abstract data types • Encapsulation and Inheritance • Object inherits properties of superclasses • Encapsulation hides data representation and method (The closest to methods are triggers, but with no encapsulation and inheritance) Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  38. Object ID Not supported in relational models Relationships OODM Interclass references Class hierarchy inheritance Relational models Primary and foreign keys Access Relational models SQL OODM Navigational Record at a time Resembles hierarchical and network models OODM vs. E-R Data Models (con’t.) Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  39. OODBMS • Database management system integrates benefits of typical database systems with OODM characteristics • Handles a mix of data types • Follows OO rules • Follows DBMS rules Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  40. OODBMS Advantages • More semantic information • Support for complex objects • Extensibility of data types • May improve performance with efficient caching • Versioning (maintain different versions of the same object) • Reusability (classes can be reused) • Inheritance speeds development and application • Potential to integrate DBMSs into single environment Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  41. OODBMS Disadvantages • Strong opposition from the established RDBMSs • Lack of theoretical foundation • Throwback to old pointer systems • Lack of standard ad hoc query language • Lack of business data design and management tools • Steep learning curve • Low market presence • Lack of compatibility between different OODBMSs (different to switch) Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  42. OO Influences on Relational Model • Extensibility of new user-defined (abstract) data types • Complex objects • Inheritance • Procedure calls (rules or triggers) • System-generated identifiers (OID surrogates) Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

  43. The Next Generations of DBMS • Object-oriented database systems • Artificial intelligence systems • Expert systems • Distributed database • The Internet Database Systems: Design, Implementation, & Management, 5th Edition, Rob & Coronel

More Related