220 likes | 427 Views
Advanced Database Systems Module 6 Object Oriented and Object Relational. School of Computer Information Engineering S HANDONG F INANCE I NSTITUTE. Objectives. Why ORDB (Object-Relational Database) Compare and Contrast OODB with ORDB What is the Object-Relational Model.
E N D
Advanced Database SystemsModule 6Object Oriented and Object Relational School of Computer Information Engineering SHANDONG FINANCE INSTITUTE
Objectives • Why ORDB (Object-Relational Database) • Compare and Contrast OODB with ORDB • What is the Object-Relational Model
Flattening and scattering: unnatural? P# P1 P2 P3 P# P1 P2 P3 Qty 600 300 150 Qty 200 100 450 City Status Supplier 20 Melb S1 Syd S2 30 What’s Wrong with Relational View? Business Object Vs. ??
Representing the Real World • Normalisation creates relations • Fragmentation leads to many joins • Inefficient • OO applications support non-first-normal-form values, where an object can contain another object(s)
Limitations of Relational Model • Huge data sets (eg. WWW) • Need for more precise mapping of real world items • New types of database objects • Multimedia like photos, video, and audio • Entire documents • E-mail • Ability to manage complicated network of multiple items, all having complex relationships with one another
What is Wrong? Impedance Mismatch • Mismatch between application and DBMS data structures • Application creates complex data structures • Application wants to access them in specific ways • Procedural Language: “record-at-a-time” while SQL “set-at-a-time” • 30% of programming effort goes to converting database formats into/out of program-internal formats (Atkinson et al., 1983) • need for cursors (temporary memory for query results)
“impedance mismatch”, So What? “For years object gurus claimed that you shouldn’t use relational databases to store objects because of the “object/relational impedance mismatch.” Yes, the object paradigm is different from the relational paradigm, but for 99% of you the reality is that your development environment is object oriented and your persistence mechanism is a relational database. Deal with it!” Scott Ambler (2000)
Need to close the Semantic Gap • How do we solve the impedance mismatch problem? • Bring application and database type systems closer. • Integrate programming language and database.
What are the Options? • Object-Oriented DBMS • Add database functionality to object-oriented programming language • Object-Relational DBMS • Add object-oriented functionality to database language (eg. SQL) • OOPL with Relational DBMS • Persistent programming language (PPL) is a programming language extended with constructs to handle persistent data
What do we stand for? • Evolution vs Revolution • Practical Approach vs Ideal Approach • Market Driven vs Research Driven • Exploitative vs Defensive
What is an Object? • Object - An “abstraction” of a real world entity • Contains: • A name • Associated data • Operations & ‘Methods’ • Interface • Operations: a function or transformation that may be applied to or by objects in a class. • Method: The implementation of an operation
Object-Oriented Databases • OODBMS aimed at applications where an object-centric viewpoint is appropriate. • Typical user sessions consist of retrieving a few objects and working on them for long periods • Transactions are likely to be of a very long duration
OODBMS - Advantages • Rich type system • Better at modelling complex objects • Better performance on certain data structures • No impedance mismatch • eg genomics
Complex Object Types • Objects can be aggregates of (sub-)objects. • A particular problem in dealing with these objects is determining the object boundary. • Problematic when some component object is apparently a component of more than one "parent" object at the same time. • eg a software component, such as a file, may be part of several applications. This kind of situation leads to problems in manipulating the complex objects. • What does it mean to remove, install, copy, or update an application that contains shared components?
Class (Type) Hierarchies • Creation of new types based on existing ones • Eg. Image Compressed image Low resolution image
OODBMS - Disadvanteges • Strong opposition from established players • Lack of theoretical foundation • Retrogressive to the old pointer system • Lack of standard ad hoc query language • Lack of business data design and management tools • Steep learning curve - complexity • Lack of resources • Lack of support for views and security
Object-Relational Approach • Provides an evolutionary migration path for relational DBMS users who need object-oriented features • Makes use of relational DBMS infrastructure • New types required to better represent the application domain • New operators (functions) required to better represent the behaviour of these types • (operators manipulate types)
Object Relational Model (ORM) • Benefit from both relational and OO • RDB: mature, mathematically sound, huge amount of applications • OODB: young, CAD/CAM applications, data abstraction and reusability • Based on standard • SQL3/SQL99 • Allow pre-existing applications • Protect former investment • Easy acceptance