CS457 Object-Oriented Databases Chapters 21-22 as reference
description
Transcript of CS457 Object-Oriented Databases Chapters 21-22 as reference
![Page 1: CS457 Object-Oriented Databases Chapters 21-22 as reference](https://reader035.fdocuments.us/reader035/viewer/2022081503/56815863550346895dc5c161/html5/thumbnails/1.jpg)
1
CS457 Object-Oriented Databases
Chapters 21-22 as reference
![Page 2: CS457 Object-Oriented Databases Chapters 21-22 as reference](https://reader035.fdocuments.us/reader035/viewer/2022081503/56815863550346895dc5c161/html5/thumbnails/2.jpg)
2
• Limitations to the relational model?
• Examples of applications that will not work well with the relational model?
![Page 3: CS457 Object-Oriented Databases Chapters 21-22 as reference](https://reader035.fdocuments.us/reader035/viewer/2022081503/56815863550346895dc5c161/html5/thumbnails/3.jpg)
3
Shortcomings of DB models for:
• CAD/CAM - keep track of 1000's of matching parts and subassemblies– relational inefficient for this– object versioning
• complex market-oriented operations (securities)• geographical information systems• CASE• OA (office automation)• multimedia databases• WWW
![Page 4: CS457 Object-Oriented Databases Chapters 21-22 as reference](https://reader035.fdocuments.us/reader035/viewer/2022081503/56815863550346895dc5c161/html5/thumbnails/4.jpg)
4
Different because of:
• more complex structures for objects
• new data types for storing images, text, user defined types
• nonstandard application specific operations
• stored procedures (available in some RDBS, such as ORACLE)
![Page 5: CS457 Object-Oriented Databases Chapters 21-22 as reference](https://reader035.fdocuments.us/reader035/viewer/2022081503/56815863550346895dc5c161/html5/thumbnails/5.jpg)
5
OODB systems
• prototypes: ORION, IRIS, ENCORE,
• Commercial products: Postgres, ObjectStore, Versant, Objectivity/DB, O2, Itasca (commercial version of ORION), Gemstone/Opal, POET
![Page 6: CS457 Object-Oriented Databases Chapters 21-22 as reference](https://reader035.fdocuments.us/reader035/viewer/2022081503/56815863550346895dc5c161/html5/thumbnails/6.jpg)
6
OODB
• Some people felt the word object-oriented is too close to OOPL
• ODB is more generic
![Page 7: CS457 Object-Oriented Databases Chapters 21-22 as reference](https://reader035.fdocuments.us/reader035/viewer/2022081503/56815863550346895dc5c161/html5/thumbnails/7.jpg)
7
Different approaches to designing ODB1. Applications written in extension of existing
OOPL (1st generation OODB)• language, compiler, execution environment, etc.
extended to incorporate – DB functionality – store and manage objects created by OOPL
• Selling point - unified programming and DB language but need query optimization, etc. – Gemstone (Smalltalk), Poet (C++)
![Page 8: CS457 Object-Oriented Databases Chapters 21-22 as reference](https://reader035.fdocuments.us/reader035/viewer/2022081503/56815863550346895dc5c161/html5/thumbnails/8.jpg)
8
Designing cont’d
2. Extend relational DB to include OO features:
• OID, type hierarchy, inheritance, encapsulation, arbitrary data types, nested objects, etc.
• Already familiar with DBMS but performance decreased
• Postgres - extended Ingres, Oracle
![Page 9: CS457 Object-Oriented Databases Chapters 21-22 as reference](https://reader035.fdocuments.us/reader035/viewer/2022081503/56815863550346895dc5c161/html5/thumbnails/9.jpg)
9
Designing cont’d
3. Start entire process from scratch (next generation?)
• unify relational and OO system
![Page 10: CS457 Object-Oriented Databases Chapters 21-22 as reference](https://reader035.fdocuments.us/reader035/viewer/2022081503/56815863550346895dc5c161/html5/thumbnails/10.jpg)
10
Object Data Model
• Bring concepts of OOPL into DB systems– Object corresponds to real-world object– Object is data and behavior, object has
attributes and operations– Data object has OID - immutable– Group data objects into classes - abstract
mechanism, share same structure and behavior
![Page 11: CS457 Object-Oriented Databases Chapters 21-22 as reference](https://reader035.fdocuments.us/reader035/viewer/2022081503/56815863550346895dc5c161/html5/thumbnails/11.jpg)
11
ODM
Class has:– instances– methods and data - encapsulation for information
hiding - access only through methods– composite classes - composed of multiple types– nested objects - contains another object– complex objects - set of objects – class hierarachy (ISA) – specialization - define new
classes from existing ones– inheritance of attributes and methods - reuse
![Page 12: CS457 Object-Oriented Databases Chapters 21-22 as reference](https://reader035.fdocuments.us/reader035/viewer/2022081503/56815863550346895dc5c161/html5/thumbnails/12.jpg)
12
ODM
Completeness• DBS needs to be computationally complete
(Turing)• SQL not computationally complete - unless
embedded SQL - impedance mismatch, since sets
• connections with DML and OOPL in ODB more acceptable
![Page 13: CS457 Object-Oriented Databases Chapters 21-22 as reference](https://reader035.fdocuments.us/reader035/viewer/2022081503/56815863550346895dc5c161/html5/thumbnails/13.jpg)
13
ODM
Add features such as: – concurrency – recovery – schema evolution– Versions– What about query language?– Performance?
![Page 14: CS457 Object-Oriented Databases Chapters 21-22 as reference](https://reader035.fdocuments.us/reader035/viewer/2022081503/56815863550346895dc5c161/html5/thumbnails/14.jpg)
14
ODM
Object identity OID
• correspondence between real-world and database objects
• used to refer to objects in application programs and in references between objects (relationships)
• unique identity to each independent object
![Page 15: CS457 Object-Oriented Databases Chapters 21-22 as reference](https://reader035.fdocuments.us/reader035/viewer/2022081503/56815863550346895dc5c161/html5/thumbnails/15.jpg)
15
OID vs. primary key
• identity based vs. value-based
• unique over entire DB and even over distributed DB (if primary key changes, still same real-world object)
• immutable - values of OID for object should not change
- OID not assigned to another object
- not dependent on any attribute values
- not use physical address
• system generated OID
• not visible to user
![Page 16: CS457 Object-Oriented Databases Chapters 21-22 as reference](https://reader035.fdocuments.us/reader035/viewer/2022081503/56815863550346895dc5c161/html5/thumbnails/16.jpg)
16
Swizzling
• All references in cached objects replaced with object's address
• pointer to other memory resident objects - swizzling
• saves OID lookup with subsequent references
![Page 17: CS457 Object-Oriented Databases Chapters 21-22 as reference](https://reader035.fdocuments.us/reader035/viewer/2022081503/56815863550346895dc5c161/html5/thumbnails/17.jpg)
17
ODM
Encapsulation• information and operations, structure and behavior• implementation hidden• define behavior of object using operations• object accessible through predefined operations -
methods• method invoked by sending messages• If query on attributes? SQL violates
encapsulation
![Page 18: CS457 Object-Oriented Databases Chapters 21-22 as reference](https://reader035.fdocuments.us/reader035/viewer/2022081503/56815863550346895dc5c161/html5/thumbnails/18.jpg)
18
OSQL – Object SQL
• ODMG has provided standards for ODB just like relational databases.
• Result is OSQL
![Page 19: CS457 Object-Oriented Databases Chapters 21-22 as reference](https://reader035.fdocuments.us/reader035/viewer/2022081503/56815863550346895dc5c161/html5/thumbnails/19.jpg)
19
Implementation Issues:
• composite objects• nested - no joins needed
– path queries instead of joins
• pointer (OID) to nested object• when bring in an object into memory, bring in nested
objects as well• replace OID with memory address (can't do this in
relational)– eager and lazy swizzling
• fast access - memory resident
![Page 20: CS457 Object-Oriented Databases Chapters 21-22 as reference](https://reader035.fdocuments.us/reader035/viewer/2022081503/56815863550346895dc5c161/html5/thumbnails/20.jpg)
20
Placing objects on disk?
• clustering of objects– all of same class together– subclass follows superclass
• nested objects
• indexes for objects? (just like relations)
![Page 21: CS457 Object-Oriented Databases Chapters 21-22 as reference](https://reader035.fdocuments.us/reader035/viewer/2022081503/56815863550346895dc5c161/html5/thumbnails/21.jpg)
21
Additional topics
• schema evolution?• views?
• Extended relational• Now object-relational
– Examine Oracle documentation to see how OO features included in 9i
– Can create both tables and objects