1 / 61

Chapter 18

Chapter 18. Object Database Management Systems. Outline. Motivation for object database management Object-oriented principles Architectures for object database management Object database definition and manipulation in SQL:2003 Object database definition and manipulation in Oracle 10g.

kamal-wall
Download Presentation

Chapter 18

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 18 Object Database Management Systems

  2. Outline • Motivation for object database management • Object-oriented principles • Architectures for object database management • Object database definition and manipulation in SQL:2003 • Object database definition and manipulation in Oracle 10g

  3. Motivation: Complex Data • Most relational DBMSs support only a few data types. • Many business applications require large amounts of complex data such as images, audio, and video. • Integration of complex data with simple data drives the demand for object database technology

  4. Motivation: Type System Mismatch • Increasing use of database access in procedural code • Different data types used in programming languages versus DBMSs • Data type mismatch makes software more difficult to develop. • A relational DBMS cannot perform elementary operations on complex data.

  5. Application Examples • Dental Office Support • Real Estate Listing Service • Auto Insurance Claims

  6. Object-Oriented Principles • An object is a combination of data and procedures. • A class is a prototype that defines the variables and methods common to all objects of the class. • Three underlying principles: encapsulation, inheritance and polymorphism.

  7. Encapsulation • Objects can be accessed only through their interfaces. • Classes can be reused rather than just individual procedures. • More complex classes can be defined using simpler classes. • Provides a form of data independence.

  8. Bond Class Example CLASS Bond { // VARIABLES: ATTRIBUTE Float IntRate; ATTRIBUTE Date Maturity; // METHODS: Float Yield(); // Computes the Bond’s Yield };

  9. Inheritance • Sharing of data and code among similar classes (classes and subclasses). • Inherit variables and methods from parent classes • Use methods and variables of ancestor classes • Provides an improved organization of software and incremental reusability.

  10. Inheritance Examples

  11. Multiple Inheritance Example

  12. Polymorphism • Ability to choose among multiple implementations • Benefits • Incremental modification of code • Smaller vocabulary of method names • Requesting a method execution involves sending a message to an object • Client-server processing and object-oriented computing are closely related.

  13. Processing a Message

  14. Binding • Associating an implementation with a message • Static binding • Performed at compile-time • More efficient but less flexible • Dynamic binding • Performed at run-time (late binding) • More flexible but less efficient

  15. Strong Type Checking • Complex expressions can involve many methods and objects • Incompatibility errors common in code • Ability to ensure that programming code contains no incompatibility errors • An important kind of error checking for object-oriented coding

  16. Programming Languages versus DBMSs • Programming languages have used object-oriented principles for many years. • Programming languages emphasize software maintenance and code reusability. • Object DBMSs are more recent. • Relax encapsulation to reference an object’s data in a query. • Simpler inheritance mechanisms in DBMSs

  17. Object Database Architectures • Adding object-oriented features to a DBMS is a good idea • Many approaches about the features to add and how features should be added. • Some approaches provide small extensions that leave object features outside the DBMS. • Other approaches involve a complete rewrite of the DBMS to accommodate objects • Marketplace will determine best approaches

  18. Large Objects and External Software • Large object storage along with external software to manipulate large objects • BLOB and CLOB data types • The large object approach is simple to implement and universal. • The large object approach suffers from serious performance drawbacks.

  19. Large Object Architecture

  20. Specialized Media Servers • Dedicated server manages complex data • Application programming interface (API) to access complex data. • Good performance for specific kinds of complex data • Limited range of operations supported • Poor performance when combining simple and complex data

  21. Specialized Media Server Architecture

  22. Object database middleware • Middleware to manage complex data stored outside of a database along with traditional data stored in a database • Integrate complex data stored on PCs and remote servers with relational databases • Possible performance problems because of a lack of integration with a DBMS.

  23. Object Middleware Approach

  24. Object-Relational DBMS • A relational DBMS extended with an object query processor for user-defined data types • User-defined types for complex data • User-defined functions in SQL statements • SQL:2003 standard • Good integration of complex data with reliability of relational DBMS

  25. Component Architecture for Object Relational DBMSs

  26. Typical User-Defined Types • Audio • Video • Text • Image • Spatial • Time series • XML

  27. Other Object Features • Subtable families • Reference and row data types • Nested tables

  28. Object-Oriented DBMS • A new kind of DBMS designed especially for objects. • Object-oriented DBMSs have an object query processor and an object kernel. • The Object Data Management Group (ODMG) provides the standard for object-oriented DBMSs.

  29. Component Architecture for Object-Oriented DBMSs

  30. Summary of Architectures • Market niche for each architecture • Simpler architectures less popular over time • Object database middleware coexist with other approaches • Object-relational approach dominates object-oriented approach

  31. SQL:2003 Object Features • Very large standard • Core language part • Parts and packages for non core features • Details about basic and enhanced object support • Two levels of conformance

  32. SQL:2003 Parts • Core parts (1,2,11): framework, foundation, schemas • Non core parts • Call level interface • Persistent stored modules • Management of external data • Object level bindings • XML specifications

  33. SQL:2003 Packages • Enhanced data-time facilities • Enhanced integrity management • Basic object support • Enhanced object support • Active databases • OLAP facilities

  34. User-Defined Types • Bundles data and procedures • Support definition of structured types, not just extensions of standard types • Use as data types for columns in tables, passed as parameters, and returned as values • User-defined functions can be used in expressions in the SELECT, the WHERE, and the HAVING clauses.

  35. User-Defined Type Example

  36. Explicit Methods • Return single values and use input parameters • Implicit first parameter: part of user-defined type • CREATE METHOD statement for method body • Mutation methods: change values • Procedures and functions not associated with types

  37. Implicit Methods • Automatically exist for all user-defined types • Constructor method: creates an empty instance • Observer methods: retrieve values • Mutation methods: change values

  38. User-Defined Type Usingan Array Example 2: Triangle type using an ARRAY CREATE TYPE Triangle AS ( Corners Point ARRAY[3], Color INTEGER ) METHOD Area() RETURNS FLOAT, -- Computes the area METHOD Scale (Factor FLOAT) RETURNS Triangle -- Computes a new triangle scaled by factor NOT FINAL;

  39. User-Defined Type Using a Multiset Example 3: Polygon type using an ARRAY CREATE TYPE Triangle AS ( Corners Point MULTISET, Color INTEGER ) METHOD Area() RETURNS FLOAT, -- Computes the area METHOD Scale (Factor FLOAT) RETURNS Polygon -- Computes a new polygon scaled by factor NOT FINAL;

  40. Table Definitions • Traditional style: foreign keys to link tables • Typed tables: supports object identifiers and object references • Row type constructor: supports rows as variables and parameters

  41. Row Type Usage

  42. User-Defined Type Usage

  43. Subtable Families • A table can be declared as a subtable of another table. • A subtable inherits the columns of its parent tables. • SQL:2003 limits inheritance for tables to single inheritance. • Set inclusion determines the relationship of a table to its subtables.

  44. Subtable Example

  45. Subtable Side Effects • Subtable insert: corresponding row is inserted into each ancestor table. • Parent update: column updated in all direct and indirect subtables • Inherited column update: column is changed in each ancestor table • Deletion: every corresponding row in both parent and subtables is also deleted.

  46. Manipulating Complex Objects and Subtable Families • Path expressions to manipulate columns with row references. • References to methods in expressions using the dot notation • Testing membership in a specific table without being a member of any subtables.

  47. Using the ROW Keyword

  48. Obtaining Object Identifiers

  49. Path Expression Example

  50. Oracle 10g Object Features • Supports most parts of the SQL:2003 object packages • User-defined types • Typed tables • Other object features

More Related