OODB
OODB
Main Memory
SQL
Object-Oriented Paradigm
• Our environment exclusively consists of objects
• Together with the objects comes their behavior; i.e. objects
are described by their functionality
• Mostly we know the functionality of objects but we don't
know how this functionality is realized (encapsulation)
• Objects react to messages
• Only the objects themselves decide in which way they
react to a message
• Different objects may react to the same message in
different ways (polymorphism)
• Objects inherit characteristics and abilities as a result of
their membership of a special class or category
• The concepts of inheritance and polymorphism can best be
exploited if the underlying system supports run-time type
checking and late binding - the operation to be used is
choosen at run time and converted to a program address
OODB
Main Memory
SQL
Definisi
• Menurut Kim 1991:
– OODM :
Model data lojik yang merupakan hasil
Capture dari semantik objek yang didukung
oleh OOP
– OODB:
koleksi objek yang di share dan bersifat
persisten yang didefinisikan dalam OODM
– OODBMS:
Pengelolaan OODB
Object Data Model
Traditional Semantic OO Special
DB System Data Model Programming Requiement
• Persistence •Object ID
•Sharing •Encapsuation
•Transaction • Generalization •Inheritance • Versioning
•Concurrent •Type & Class
Control •Aggregation •Methods • Schema
•Recovery •Complex Evolution
•Security Object
•Integrity •Polymorphism
•Query •Extenxibility
Document
Capter
Containt
Title : String Title : String
Number : Int Revision : Int Index
Name : String
Auther
OO VS EER Data Modeling
• OO • EER
– Class – Entity type
– Object – Entity Instance
– Association – Relationship
– Inheritance of – Inheritance of
atribut attribut
– Inheritance of – No representation
behavior of behavior
Database Architecture
• Extended Database System
– Menyediakan fungsi untuk query basiswata
– Programer dapat berinteraksi dengan :
• Aplikasu bahasa pemrograman
• Bahasa SQL
• Database Programming Language
– Perluasan dari OOP, seperti C++, Java yang
menyediakan persistensi, concurrent control, dll
– Bahasa query dan OOP dieksekusi dalam lingkungan
aplikasi, berbagi data dan sstem yang sama
Database Architecture….
• Object Manager (persistent object stores)
– Sebuah paket yang disediakan leh file system atau
virtual memori
– Menyediakan repositori untuk object persistent
– Jangan melibatkan query atau bahasa pemrograman
– Aplikasi yang sederhana
• Database System Generator
– Mengijinkan implementator basisdata untuk
membangun DBMS untuk kebutuhannya
Database Architecture
DB Programing Language
Extended DBS
Database
System
generator
Object Manager
ODMS
• Database Prog. Language • Extended RDB System
– O2 – Postgres
– ObjectStore – Starburst
– Objectivity – Algres
– ONTOS – Ingres
– Versant – Sybase
– GBase – Xidak Orion
– STATICE • Object Manager
– MCC Orion – POMS
– Itasca – Mneme
• Database Syst. Generator – ObServer
– Exodus – Camelot
– Genesis – LOOM
OQL
• Stand Alone:
– Select struct (n: p.name, s: p.sex) from people
as p where p.age < 18
• Embedded in C++:
– D_oql_execute(teenagers, “Select p from
people as p where p.age < 18”
Operand
• Constans:
– 1, true, “string”, Nill
• Named Object
– People; President
• Variable
– P; p.age or p->age; I[i]
Operator
• Numerical: +, - , *, /, mod, abs
• Comarison : =, !=, >, <, >=
• Boolean : not, and, or
• Constructor:
– Object Employee(name:”John”, Salary:15000)
– Collection :Vector(1, 2, 3)
– Structure : struct(name: P.name, age: p.age)
– Literal Collection : set(1,2,3)
Operator on Collections
• Set
– Intersection, union, except
• Selection
– Select result(x, y, …) from col1 as x, col2 as y,…
where predicate(x,y,…)
• Quantificators
– For All x in collection
– Exist x in collection
• Conversion
– Element(singleton)
– Flatten(collection_of_collection)
OQL Select – From - Where
Select <list of values> from <list of collection
and typical member> where <condition>
• Collection in Fromcan be any expression
that evaluate to a collection