Chapter 17 - Object-Oriented Database Processing
- A Sketch of Object-Oriented Programming
- OOP Terminology
- OOP object is an encapsulated structure(self contained) with attributes and methods(sequence of instructions)
- interface - external appearance of an object
- implementation - encapsulated internals of an object
- inheritance - subclasses and superclasses
- polymorphism - calling special versions of a method for different subclasses of the same class
- object class - logical structure of an object (name, attributes, methods)
- object - instance of an object class
- transient object - only exists in volatile memory during execution of a program
- persistent object - has been saved to permanent storage
- OOP Example - see Fig. 17-3
- Object Persistence
- save object instances data values
- convert in-memory object pointers to permanent, unique IDs (swizzling)
- save object class methods
- Object Persistence Using Tradional File Storage lot of work for programmer; only works when application has a few simple objects whose structure does not change
- Object Persistence Using Commercial Relational DBMS programmer needs to define relational structures to represent objects, write the code to interface with the DBMS to get / put obhects and to swizzle pointers
- Object Persistence USing ODBMS - designed for object persistence [just save ODB]
- Comparing ODBMS and Traditional DBMS
- ODBMS Advantages
- integrated with programming language
- automatic method storage
- user-defined types
- complex data readily processed
- automatic persistent object IDs
- single-level memory
- ODBMS Disadvantages
- requires OOP
- little existing data in object form
- nonexistent (or poor) query and reporting tools
- limited concurrency control and transaction management
- unproven performance
- substantial change and learning required
- Are ODBMS Better than Traditional DBMS?
- ODBMS Standards
- SQL3
Abstract data type(ADT) - user-defined structure that is equivalent to an OOP object
- ODMG-93
- Objects are fundamental
- Every object has a lifelong persistent, unique identifier
- Objects can be arranged into types and subtypes
- State is defined by data values and relationships
- Behaviour is defined by object operations