You know my method, Watson. Apply them. SEMINAR BỘ MÔN: CƠ SỞ DỮ LIỆU NÂNG CAO.

19
You know my method, Watson. Apply them. SEMINAR BỘ MÔN: CƠ SỞ DỮ LIỆU NÂNG CAO OBJECT-DATABASE SYSTEMS

Transcript of You know my method, Watson. Apply them. SEMINAR BỘ MÔN: CƠ SỞ DỮ LIỆU NÂNG CAO.

Page 1: You know my method, Watson. Apply them. SEMINAR BỘ MÔN: CƠ SỞ DỮ LIỆU NÂNG CAO.

You know my method, Watson. Apply them.

SEMINAR

BỘ MÔN: CƠ SỞ DỮ LIỆU NÂNG CAO

OBJECT-DATABASESYSTEMS

Page 2: You know my method, Watson. Apply them. SEMINAR BỘ MÔN: CƠ SỞ DỮ LIỆU NÂNG CAO.

NỘI DUNG

Object-Database

Extend

New data

Identity

Inheritance

Design

Challenge

ODL, OQL

Compare

Page 3: You know my method, Watson. Apply them. SEMINAR BỘ MÔN: CƠ SỞ DỮ LIỆU NÂNG CAO.

GIỚI THIỆU

Strings

IntegersSmall

Fixed collection

DatesTypid Data Types

Floats

Relational

Database

Complex kind of data

CAD/CAM

GISMultimedia Repositorie

s

Document manageme

nt

?

Page 4: You know my method, Watson. Apply them. SEMINAR BỘ MÔN: CƠ SỞ DỮ LIỆU NÂNG CAO.

GIỚI THIỆU

Object-Database

Support more complex kinds of data

• Object-Oriented Database Systems

• Object-Relational Database Systems

Two paths

Good for apps where complex objects play a central role Influenced by object-oriented PLs

An attempt to add DBMS functionality to a PL environment Object Data Model & Object Query Language are developed

Extend relational database systems with the functionality necessary to support a broader class of applications Bridge between relational and object-oriented paradigms

RDBMS vendors are adding ORDBMS functionality

Page 5: You know my method, Watson. Apply them. SEMINAR BỘ MÔN: CƠ SỞ DỮ LIỆU NÂNG CAO.

OBJECT vs RELATIONAL

Relation Model

Relation

Object Model

ThemeGallery is a Design Digital Content & Contents mall developed by Guild Design Inc.

Class

Tuple Instance Object

Column Attribute

Store Procedure Method

Similar

Similar

Similar

Different

Theo slide ODBMS, Hong Yang, NJIT

Page 6: You know my method, Watson. Apply them. SEMINAR BỘ MÔN: CƠ SỞ DỮ LIỆU NÂNG CAO.

OBJECT vs RELATIONAL

ModelConcepts

Relational model concept

Object model concept

Object model benifits

Data abstractio

n

Intersection entities and indexing to represent references between tuples.

Object identification (OIDS) to directly represent references between objects.

Simpler shcema to represent complex data.

Inheritance

Type codes. Class hierachy. Direct representation of the references between type and subtypes as well as support for specialized processing for each subtype.

Encapsulation

"If then else if" code based on type codes and management of the code, usually with libraries.

Encapsulation provides built-in dispatching to ensure the correct code executes on the correct data.

Reduced application code and reduced chance of error where the wrong code executes on the right data.Theo slide ODBMS, Hong Yang, NJIT

Page 7: You know my method, Watson. Apply them. SEMINAR BỘ MÔN: CƠ SỞ DỮ LIỆU NÂNG CAO.

HOW ODB WORK?

from Wikipedia

Page 8: You know my method, Watson. Apply them. SEMINAR BỘ MÔN: CƠ SỞ DỮ LIỆU NÂNG CAO.

MOTIVATING EXAMPLE

Dinky Entertainment Company

Assets: collection of cartoon characters

Especially: Herbert the Worm

Also licensing Herbert’s image, voice, video

DB: products & films

Page 9: You know my method, Watson. Apply them. SEMINAR BỘ MÔN: CƠ SỞ DỮ LIỆU NÂNG CAO.

NEW DATA TYPES

User-defined data types: Herbert’s image, voice, video footage

Object identity important to store references instead of copies of

objects Inheritance

Images

CompressedLow-

resolution High-

resolution

Page 10: You know my method, Watson. Apply them. SEMINAR BỘ MÔN: CƠ SỞ DỮ LIỆU NÂNG CAO.

IN RDBMS: BLOBs

Binary Large ObjectFurther processing by the user

application programNot efficient as we have to

retrieve all BLOBs in a collection

Page 11: You know my method, Watson. Apply them. SEMINAR BỘ MÔN: CƠ SỞ DỮ LIỆU NÂNG CAO.

MANIPULATING THE NEW DATA

Cereal Company: Clog wants to lease an image of Herbert in front of a sunrise

SELECT F.Frameno, thumbnail(F.image), C.lease_priceFROM Frames F, Categories CWHERE F.category = C.cid AND is_sunrise(F.image) AND is_herbert(F.image)

Frames(Frameno: integer, image: jpeg_image, category: integer)Categories(cid: integer, name: text, lease_price:float, comments: text)

Methods written in an imperative language like Java registered with a DBS: can be used in the same way as built-in methods such as =, +, -, <, >

Page 12: You know my method, Watson. Apply them. SEMINAR BỘ MÔN: CƠ SỞ DỮ LIỆU NÂNG CAO.

Dinky executives want to make sure that a number of Herbert films are playing at theaters near Andorra when the cereal hits the shelves

SELECT N.theater->name, N.theater->address, F.titleFROM Nowshowing N, Films F, Countries CWHERE N.film = F.filmno AND overlaps(C.boundary, radius(N.theater->address,100)) AND C.name = ‘Andorra’ AND ‘Herbert the Worm’ = F.stars[1] theater attribute in Nowshowing is a reference to an object in another tablestars attribute of the Films table is a set of names of each film’s starsNowshowing and Films are joined by the equijoin clauseNowshowing and Countries are joined by the spatial overlap clause

MANIPULATING THE NEW DATA

Page 13: You know my method, Watson. Apply them. SEMINAR BỘ MÔN: CƠ SỞ DỮ LIỆU NÂNG CAO.

ADDITIONAL FEATURES

User Defined Methods:User defined types are manipulated via

their own Methods, for example, is_herbert

Operators for Structured Types:For example, the ARRAY type supports standard array operation of accessing an element

Operators for Reference types: Reference types are dereferenced via an arrow (->) notation

Page 14: You know my method, Watson. Apply them. SEMINAR BỘ MÔN: CƠ SỞ DỮ LIỆU NÂNG CAO.

SUMMARY

Traditional relational systems offer limited flexibility in the data types available

Data is stored in tables and the type of each field value is limited to simple atomic types

Limited type systems can be extended in three ways (complex types): User-defined data types Structured types Reference types

Page 15: You know my method, Watson. Apply them. SEMINAR BỘ MÔN: CƠ SỞ DỮ LIỆU NÂNG CAO.
Page 16: You know my method, Watson. Apply them. SEMINAR BỘ MÔN: CƠ SỞ DỮ LIỆU NÂNG CAO.
Page 17: You know my method, Watson. Apply them. SEMINAR BỘ MÔN: CƠ SỞ DỮ LIỆU NÂNG CAO.
Page 18: You know my method, Watson. Apply them. SEMINAR BỘ MÔN: CƠ SỞ DỮ LIỆU NÂNG CAO.
Page 19: You know my method, Watson. Apply them. SEMINAR BỘ MÔN: CƠ SỞ DỮ LIỆU NÂNG CAO.

THE END