odbms
-
Upload
priyamvada1234 -
Category
Documents
-
view
164 -
download
10
description
Transcript of odbms
![Page 1: odbms](https://reader033.fdocuments.us/reader033/viewer/2022061120/546c2f4db4af9fda238b466a/html5/thumbnails/1.jpg)
what is object oriented database ?
ODBMS
An object-oriented database management system (OODBMS), sometimes shortened to ODBMS for object database management system, is a database management system (DBMS) that supports the modelling and creation of data as objects.
![Page 2: odbms](https://reader033.fdocuments.us/reader033/viewer/2022061120/546c2f4db4af9fda238b466a/html5/thumbnails/2.jpg)
ODBMS
ODBMS includes some kind of support for classes of objects and the inheritance of class properties and methods by subclasses and their objects.
There is currently no widely agreed-upon standard for an OODBMS, and OODBMS products are considered to be still in their imature stage.
![Page 3: odbms](https://reader033.fdocuments.us/reader033/viewer/2022061120/546c2f4db4af9fda238b466a/html5/thumbnails/3.jpg)
In the meantime, the object-relational database management system (ORDBMS), the idea that object-oriented database concepts can be superimposed on relational databases, is more commonly available products.
An object-oriented database interface standard is being developed by an industry group, the Object Data Management Group (ODMG).
ODBMS
![Page 4: odbms](https://reader033.fdocuments.us/reader033/viewer/2022061120/546c2f4db4af9fda238b466a/html5/thumbnails/4.jpg)
ODBMS
Object Data Management Group has set a standard for Object Databases (version 3.0).
ODL - Object Definition Language
OML - Object Manipulation Language
![Page 5: odbms](https://reader033.fdocuments.us/reader033/viewer/2022061120/546c2f4db4af9fda238b466a/html5/thumbnails/5.jpg)
Typical Applications for ODBMS:- Computer-aided design (CAD)- Computer-aided software engineering
(CASE)- Multimedia databases
--- Images, video, games, etc.
- Office automation systems (OIS)- Expert database systems
ODBMS
![Page 6: odbms](https://reader033.fdocuments.us/reader033/viewer/2022061120/546c2f4db4af9fda238b466a/html5/thumbnails/6.jpg)
OBJECT STRUCTURE
Objects basically consist of the following:
Attributes - Attributes are data which defines the characteristics of an object. This data may be simple such as integers, strings, and real numbers or it may be a reference to a complex object.
Methods - Methods define the behavior of an object and are what was formally called procedures or functions.
ODBMS
![Page 7: odbms](https://reader033.fdocuments.us/reader033/viewer/2022061120/546c2f4db4af9fda238b466a/html5/thumbnails/7.jpg)
Attributes Contain current state of an object.
Attributes can be classified as simple or complex.
Simple attribute can be a primitive type such as integer, string, etc., which takes on literal values.
Complex attribute can contain collections and/or references.
Reference attribute represents relationship.
An object that contains one or more complex attributes is called a complex object.
ODBMS
![Page 8: odbms](https://reader033.fdocuments.us/reader033/viewer/2022061120/546c2f4db4af9fda238b466a/html5/thumbnails/8.jpg)
Object Identity
Object identifier (OID) assigned to object when it is created that is:
– System-generated.
– Unique to that object.
– Invariant.
– Independent of the values of its attributes (that is, its state).
– Invisible to the user (ideally).
ODBMS
![Page 9: odbms](https://reader033.fdocuments.us/reader033/viewer/2022061120/546c2f4db4af9fda238b466a/html5/thumbnails/9.jpg)
Object Identity - Implementation In RDBMS, object identity is value-based: primary key is used to provide uniqueness.
Primary keys do not provide type of object identity required in OO systems:
- key only unique within a relation, not across entire system;
- key generally chosen from attributes of relation, making it dependent on object state.
ODBMS
![Page 10: odbms](https://reader033.fdocuments.us/reader033/viewer/2022061120/546c2f4db4af9fda238b466a/html5/thumbnails/10.jpg)
Methods and Messages
Method
– Defines behavior of an object, as a set of encapsulated functions.
Message
– Request from one object to another asking second object to execute one of its methods.
ODBMS
![Page 11: odbms](https://reader033.fdocuments.us/reader033/viewer/2022061120/546c2f4db4af9fda238b466a/html5/thumbnails/11.jpg)
ODBMS
Object Showing Attributes and Methods
![Page 12: odbms](https://reader033.fdocuments.us/reader033/viewer/2022061120/546c2f4db4af9fda238b466a/html5/thumbnails/12.jpg)
Class Instance Share Attributes and Methods
![Page 13: odbms](https://reader033.fdocuments.us/reader033/viewer/2022061120/546c2f4db4af9fda238b466a/html5/thumbnails/13.jpg)
Subclasses, Superclasses, and Inheritance
• All instances of subclass are also instances of superclass.
• Principle of substitutability states that instance of subclass can be used whenever method/construct expects instance of superclass.
• Relationship between subclass and superclass known as A KIND OF (AKO) relationship.
• Four types of inheritance: single, multiple, repeated, and selective.
ODBMS
![Page 14: odbms](https://reader033.fdocuments.us/reader033/viewer/2022061120/546c2f4db4af9fda238b466a/html5/thumbnails/14.jpg)
Single Inheritance
ODBMS
![Page 15: odbms](https://reader033.fdocuments.us/reader033/viewer/2022061120/546c2f4db4af9fda238b466a/html5/thumbnails/15.jpg)
Multiple Inheritance
ODBMS
![Page 16: odbms](https://reader033.fdocuments.us/reader033/viewer/2022061120/546c2f4db4af9fda238b466a/html5/thumbnails/16.jpg)
Repeated Inheritance
ODBMS
![Page 17: odbms](https://reader033.fdocuments.us/reader033/viewer/2022061120/546c2f4db4af9fda238b466a/html5/thumbnails/17.jpg)
Class Hierarchy
class person{
string name;string address:};
class customer isa person {int credit-rating;};
class employee isa person {date start-date;int salary;};
class officer isa employee {int office-number,int expense-account-
number,};
![Page 18: odbms](https://reader033.fdocuments.us/reader033/viewer/2022061120/546c2f4db4af9fda238b466a/html5/thumbnails/18.jpg)
ODBMS
OODBMS vs RDBMS RDBMS have been around for more than 20 years, OODBMS are relatively new.
RDBMS can handle >1010 records, OODBMS up to 107.
OODBM good for storing complex descriptions (e.g., a plant schematic), RDBMS appropriate for simple, “flat” data.
![Page 19: odbms](https://reader033.fdocuments.us/reader033/viewer/2022061120/546c2f4db4af9fda238b466a/html5/thumbnails/19.jpg)
RDBMS control the DB market (>90%), OODBMS own <5% of the market.
Most commercial RDBMS come with an “Object-Relational” extension which implements an object database on top of a RDBMS.
OODBMS vs RDBMS
ODBMS
![Page 20: odbms](https://reader033.fdocuments.us/reader033/viewer/2022061120/546c2f4db4af9fda238b466a/html5/thumbnails/20.jpg)
InheritanceType hierarchy
- System permits the definition of new types based on other existing types– A subtype inherits all properties of its supertype
– A sub-class C’ of a class C is a collection of objects such that each object in C’ is also an object in C.– An object in C’ inherits all properties of C
Class hierarchy
- Multiple inheritance (inherits from more than just one superclass)- Selective inheritance (inherits only some of the properties of a superclass)
ODBMS
![Page 21: odbms](https://reader033.fdocuments.us/reader033/viewer/2022061120/546c2f4db4af9fda238b466a/html5/thumbnails/21.jpg)
Persistent Programming languages allow objects to be created and stored in a database, and used directly from a programming language
Allow data to be manipulated directly from the programming language
- No need to go through SQL.
Persistent Programming LanguagesPersistent Programming Languages
![Page 22: odbms](https://reader033.fdocuments.us/reader033/viewer/2022061120/546c2f4db4af9fda238b466a/html5/thumbnails/22.jpg)
No need for explicit format (type) changes
- Format changes are carried out transparently by system
- Without a persistent programming language, format changes becomes a burden on the programmer
– More code to be written
– More chance of bugs
Persistent Programming LanguagesPersistent Programming Languages
![Page 23: odbms](https://reader033.fdocuments.us/reader033/viewer/2022061120/546c2f4db4af9fda238b466a/html5/thumbnails/23.jpg)
Allow objects to be manipulated in-memory
- no need to explicitly load from or store to the database
- Saved code, and saved overhead of loading/storing large amounts of data
Persistent Programming LanguagesPersistent Programming Languages
![Page 24: odbms](https://reader033.fdocuments.us/reader033/viewer/2022061120/546c2f4db4af9fda238b466a/html5/thumbnails/24.jpg)
Drawbacks of persistent programming languages
Due to power of most programming languages, it is easy to make programming errors that damage the database.
Complexity of languages makes automatic high-level optimization more difficult.
Do not support declarative querying as well as relational databases
Persistent Programming LanguagesPersistent Programming Languages
![Page 25: odbms](https://reader033.fdocuments.us/reader033/viewer/2022061120/546c2f4db4af9fda238b466a/html5/thumbnails/25.jpg)
Declarative query languageNot computationally complete
Syntax based on SQL (select, from, where)
Additional flexibility (queries with user defined operators and types)
Object Query Language (OQL)
ODBMS
![Page 26: odbms](https://reader033.fdocuments.us/reader033/viewer/2022061120/546c2f4db4af9fda238b466a/html5/thumbnails/26.jpg)
The following is a sample query
“what are the names of the black product?”
Select distinct p.name
From products p
Where p.color = “black”
Valid in both SQL and OQL, but results are different.
ODBMS
Example of OQL query
![Page 27: odbms](https://reader033.fdocuments.us/reader033/viewer/2022061120/546c2f4db4af9fda238b466a/html5/thumbnails/27.jpg)
Result of the query (SQL)
Product no Name Color
P1 Ford Mustang Black
P2 Toyota Celica Green
P3 Mercedes SLK Black
- The statement queries a relational database.
=> Returns a table with rows.
Name
Ford MustangMercedes SLK
Result
Original table
Example of OQL query
![Page 28: odbms](https://reader033.fdocuments.us/reader033/viewer/2022061120/546c2f4db4af9fda238b466a/html5/thumbnails/28.jpg)
Product no Name Color
P1 Ford Mustang Black
P2 Toyota Celica Green
P3 Mercedes SLK Black
String
Ford Mustang
Result
Original table
String
Mercedes SLK
Result of the query (SQL)
- The statement queries a object-oriented database
=> Returns a collection of objects.
Example of OQL query
![Page 29: odbms](https://reader033.fdocuments.us/reader033/viewer/2022061120/546c2f4db4af9fda238b466a/html5/thumbnails/29.jpg)
Queries look very similar in SQL and OQL, sometimes they are the same
In fact, the results they give are very different
Query returns:
OQL SQLObjectCollection of objects
TupleTable
Comparison
![Page 30: odbms](https://reader033.fdocuments.us/reader033/viewer/2022061120/546c2f4db4af9fda238b466a/html5/thumbnails/30.jpg)
Foundation for several OO database management systems – ORACLE8, DB2, etc
New features – “relational” & “Object oriented”
Relational Features – new data types, new predicates, enhanced semantics, additional security and an active database
Object Oriented Features – support for functions and procedures
SQL3 “Object-oriented SQL”