17
Object Oriented Database

oodboverrlationaldatabases

Embed Size (px)

Citation preview

8/4/2019 oodboverrlationaldatabases

http://slidepdf.com/reader/full/oodboverrlationaldatabases 1/17

Object Oriented Database

8/4/2019 oodboverrlationaldatabases

http://slidepdf.com/reader/full/oodboverrlationaldatabases 2/17

� Relational databases store data in tables that are two dimensional.The tables have rows and columns. Relational database tables are"normalized" so data is not repeated more often than necessary. Alltable columns depend on a primary key (a unique value in the

column) to identify the column. Once the specific column isidentified, data from one or more rows associated with that columnmay be obtained or changed.

Object Oriented Database vs. Relational Database

8/4/2019 oodboverrlationaldatabases

http://slidepdf.com/reader/full/oodboverrlationaldatabases 3/17

� To put objects into relational databases, they must be described interms of simple string, integer, or real number data. For instance inthe case of an airplane. The wing may be placed in one table withrows and columns describing its dimensions and characteristics.The fuselage may be in another table, the propeller in another table,

tires, and so on.

� Breaking complex information out into simple data takes time and islabor intensive. Code must be written to accomplish this task.

Object Oriented Database vs. Relational Database cont«

8/4/2019 oodboverrlationaldatabases

http://slidepdf.com/reader/full/oodboverrlationaldatabases 4/17

� Objects don't require assembly and disassembly saving coding timeand execution time to assemble or disassemble objects.

� Reduced paging

� Easier navigation

� Better concurrency control - A hierarchy of objects may be locked.

� Data model is based on the real world.

� Works well for distributed architectures.

� Less code required when applications are object oriented.

Object Oriented Database Advantages

8/4/2019 oodboverrlationaldatabases

http://slidepdf.com/reader/full/oodboverrlationaldatabases 5/17

� Lower efficiency when data is simple and relationships are simple.

� Relational tables are simpler.

� Late binding may slow access speed.

� More user tools exist for RDBMS.

� Standards for RDBMS are more stable.

� Support for RDBMS is more certain and change is less likely to berequired.

Object Oriented Database Disadvantages

8/4/2019 oodboverrlationaldatabases

http://slidepdf.com/reader/full/oodboverrlationaldatabases 6/17

� Object Identity (OID)

� Attributes (Instance variables)

� Object State

� Messages and Methods

� Encapsulated Structure ± The ability to hide the object¶s internal details

Object Oriented Database Programming Terminology

8/4/2019 oodboverrlationaldatabases

http://slidepdf.com/reader/full/oodboverrlationaldatabases 7/17

� Object Class ± the logical structure of an object (name, attributes, methods)

� Object Class Library ± a group of object classes

� Object ± an instance of an object class

� Protocol ± ± collection of messages

Object Oriented Database Programming Terminology cont«

8/4/2019 oodboverrlationaldatabases

http://slidepdf.com/reader/full/oodboverrlationaldatabases 8/17

� Superclasses

� Subclasses

� Inheritance ± Single ± Multiple

� Polymorphism ± situation in which one name can be used to invoke different

functions

� Inheritance ± automatically assuming the attributes and methods of another

object at a higher class

Object Oriented Database Programming Terminology cont«

8/4/2019 oodboverrlationaldatabases

http://slidepdf.com/reader/full/oodboverrlationaldatabases 9/17

� System must support complex objects� Object identifier must be supported� Objects must be encapsulated� Systems must support types or classes

� System must support inheritance� System must avoid premature binding� System must be computationally complete� System must be extensible� System must be able to remember data locations

� System must be able to handle very large databases� System must support concurrent users� System must be able to recover from hardware and software� Data query must be simple

13 Rules for an OODBMS from the OODBS Manifesto

8/4/2019 oodboverrlationaldatabases

http://slidepdf.com/reader/full/oodboverrlationaldatabases 10/17

� Medical care ± X-rays, MRI, CT scans, and EKG traces

� Spatial and geographic databases ± maps, seismic data, satelliteimages, CAD drawings

� Financial systems ± time series data and analysis

W here Object Oriented Databases are used

8/4/2019 oodboverrlationaldatabases

http://slidepdf.com/reader/full/oodboverrlationaldatabases 11/17

� Impossible for a database vendor or a standards organization toincorporate all of these complex data types as an integral part of theRDBMS

� What we need is the capability toextend

the set of built-in datatypes of the RDBMS

� A class encapsulating the data and methods of an ADT shouldsatisfy the requirements

H ow Object Oriented Databases are created

8/4/2019 oodboverrlationaldatabases

http://slidepdf.com/reader/full/oodboverrlationaldatabases 12/17

� A new ADT would be implemented as a class in some object-oriented language

� The class would then be registered with the database system

� Once registered, the ADT becomes a candidate for an attribute type

� SQL extensions would allow the class methods to be used inqueries

H ow Object Oriented Databases are created cont«

8/4/2019 oodboverrlationaldatabases

http://slidepdf.com/reader/full/oodboverrlationaldatabases 13/17

� The class is typically called a user-defined type (UDT)

� The class methods are called user-defined functions (UDF)

� Most implementations do not store instances of a class as part of atuple

� Instead, a tuple contains a ha ndle that refers to the instance of theUDT

H ow Object Oriented Databases are created cont«

8/4/2019 oodboverrlationaldatabases

http://slidepdf.com/reader/full/oodboverrlationaldatabases 14/17

� The data members of objects might be stored in one or more hiddentables

� Hidden indices can be implemented to accelerate access to the

objects

� The object handle would also be used to access the UDFs of theclass

� Some implementations allow the class designer to implement newaccess methods

H ow Object Oriented Databases are created cont«

8/4/2019 oodboverrlationaldatabases

http://slidepdf.com/reader/full/oodboverrlationaldatabases 15/17

8/4/2019 oodboverrlationaldatabases

http://slidepdf.com/reader/full/oodboverrlationaldatabases 16/17

� A common use of UDTs is implement a container to hold multipleobjects of the same (built-in or user-defined) type

� Such a type can be used to create a multivalued attribute

� Such a datatype does not violate first normal form, since the tabledoes not contain repeating columns of the same type

H ow Object Oriented Databases are created cont«

8/4/2019 oodboverrlationaldatabases

http://slidepdf.com/reader/full/oodboverrlationaldatabases 17/17

Object Oriented Database

By Ashish Kaul

THE

EN

D!!!!