Object Oriented Database By Liem Do And Jesslyn Bui
History of Databases File Systems (1950s) hierarchical/ network (1960s) relational ( s) ODBMS (1990s-today) Store data after process created it has ceased to exist Concurrency, recovery Complex structures, fast access More reliability, less redundancy More flexibility, multiple views Better simulation, more and complex data types, more relationships (e.g.aggregation, specialization) Single language for database AND programming, no 'reconstruction' of objects
OBJECT-ORIENTED DATABASES What is an Object Oriented Database? Comparison with traditional Databases Advantages Disadvantages Code Example Myths about Object Oriented Databases Commercial ODBMS available Real Life uses of ODBMS in Industry
What is Object Oriented Database (OODB)? OODB = Object Orientation + Database Capabilities Provides data and object persistence Representation of complex data models Integrates database capabilities with object programming language capabilites
Transparent persistence
Complex data Complex data is often characterized by: A lack of unique, natural identification. A large number of many-to-many relationships. Access using traversals. Frequent use of type codes such as those found in the relational schema
Database Models Object Relational Object Relational
Object Model Three concepts are critical to understanding object models. They are: Data abstraction Encapsulation Inheritance
Relational Model
Comparison
Mapping
Comparison of object and relational terminology
Relational Database of a Cat
Object-Oriented Database of a Cat
OODB enables complex data types to be stored (e.g. CAD applications)
Object Relational Model It handles the mapping and has a cache much like an ODBMS. Data is mapped to the ODBMS and from the ODBMS based on the application needs. The ODBMS provides high- speed performance for the Internet.
Advantages Uses object oriented features for data storage. Provides transparent object persistence Allows ability to store complex data High performance Single data model
Disadvantages Lack of Familiarity Inertia Technology Fear Business Fear
Java Code Example import org.odmg.*; import java.util.Collection; Implementation impl = new com.vendor.odmg.Implementation(); Database db = impl.newDatabase(); Transaction txn = impl.newTransaction(); try { db.open("addressDB", Database.OPEN_READ_WRITE); txn.begin(); // perform query OQLQuery query = new OQLQuery("select x from Person x where x.name = \"Doug Barry\""); Collection result = (Collection) query.execute(); Iterator iter = result.iterator(); // iterate over the results while ( iter.hasNext() ) { Person person = (Person) iter.next(); // do some addition processing on the person (now shown) // now traverse to the address object and update its value person.address.street = " th Avenue South"; } txn.commit(); db.close(); }
Has a steep learning curve Slow Do not support queries Do not scale Myths about OODB
Commercial ODBMS Available Objectivity ObjectStore Goods Versant
Real Life uses of ODBMS in Industry trade stock use Internet trade use your pager use your voic book a flight use your PCS phone