Presentation on theme: "By: Blake Peters. OODB- Object Oriented Database An OODB is a database management system in which information is represented in the form of objects."— Presentation transcript:
OODB- Object Oriented Database An OODB is a database management system in which information is represented in the form of objects as used in object oriented programming. OODBs are different from relational databases which are table oriented.
OODBs combine database capabilities with object-oriented programming language capabilities. Allow object-oriented programmers to develop the product, store them as objects, and replicate or modify existing objects to make new objects.
Like relational databases use SQL to query tables, OODBs use OQL (Object Query Language) to query objects Objects can be retrieved directly without a search, by following pointers. Allows faster access to data because joins are often not needed.
Object Query Language syntax: SELECT * FROM [ INSTANCEOF ] [ WHERE ]
Object-relational mapping (ORM) is a programming technique for converting data between incompatible type systems in object-oriented programming languages. This creates a “virtual database” that can be used from within the programming language
Compared to traditional techniques of exchange between an object-oriented language and a relational database, ORM often reduces the amount of code that needs to be written
Using ORM in OODBs eliminates the need for converting data to and from its SQL form, as the data is stored in its original object representation and relationships are directly represented, rather than requiring join tables/operations.
Consider an address book entry that represents a single person along with zero or more phone numbers and zero or more addresses Using and OODB with ORM a “Person object” could be implemented with attributes/fields to hold each data item that the entry comprises: person’s name, list of phone numbers, and list of addresses.
The list of phone numbers whould itself contain “PhoneNumber objects” and so on The address book entry is treated as a single object by the programming language (it can be referenced by a single variable containing a pointer to the object) Methods could be written to return the desired phone number, address, etc
Without the use of these object mappings, retrieving data is more difficult using SQL SQL DBMS can only store and manipulate scalar values such as integers and strings organized within tables. The programmer must either convert the object values into groups of simpler values for storage in the database, or only use simple scalar values within the program.
This causes more coding for retrieval of values, and slower data access times