Database Systems: Object-Oriented Database Systems, Standards and Languages | ECS 165A, Lecture notes of Deductive Database Systems

Typology: Lecture notes

2019/2020

Uploaded on 06/15/2020

leonpan
leonpan 🇺🇸

4

(12)

286 documents

1 / 8

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ECS 165B Database Systems 1
1. Object-Oriented Database Systems,
Standards, and Languages
Reading: Chapter 8 (4th ed), Chapter 9 (5th ed)
Top ic s:
Database Applications for OODBMS
Overview of Object-Oriented concepts
Overview of the Object-Model of ODMG
Basics of Object-Oriented DB design
Conventional Database Systems and Applications
Features of “traditional” database applications:
Uniformity: Large numbers of similarly structured data items,
all of which having essentially the same size (in bytes).
Record Orientation: Basic data items consist of (fixed-length)
records.
Small Data Items: Each record (tuple) is short a tuple rarely
requires more than a few hundred bytes.
Atomic Fields: Fields within a tuple are short, length typically
within a specific range, first normal form holds.
Such applications are very well supported by data-processing
oriented data models (relational model) and concepts (storage
& file structures, query processing & optimization, transaction
management etc.)
Dr. Michael Gertz 1. Concepts of OODBS
ECS 165B Database Systems 2
Emerging “New” Database Applications
Non-standard applications:
On the Web: online product catalogs, ebay, amazon.com,
e-business, e-government, . . .
Office Information Systems and Document Management
Systems
Computer-Aided Design Environments (CAD, CAM, CAQ)
Multimedia Applications (incl. images, video, audio)
Geographic Information Systems (GIS), Information
Management in the Lifesciences, Environmental Information
Systems, . . .
Common properties and problems for these types of applications:
Need for complex data types and type systems (not just strings
and numbers)
Support of abstract data types (ADTs) and data encapsulation
Novel methods for querying (navigational/operational support
instead of just declarative support) and access structures.
Sophisticated operations on data structures necessary, much
closer on programming concepts in OO programming
languages.
Dr. Michael Gertz 1. Concepts of OODBS
pf3
pf4
pf5
pf8

Partial preview of the text

Download Database Systems: Object-Oriented Database Systems, Standards and Languages | ECS 165A and more Lecture notes Deductive Database Systems in PDF only on Docsity!

ECS 165B Database Systems

1

1. Object-Oriented Database Systems,

Standards, and Languages

Reading:

(^) Chapter 8 (4th ed), Chapter 9 (5th ed)

-^ Topics:

  • (^) Basics of Object-Oriented DB design • (^) Overview of the Object-Model of ODMG • (^) Overview of Object-Oriented concepts (^) Database Applications for OODBMS -^ Features of “traditional” database applications:^ Conventional Database Systems and Applications (^) Uniformity:

(^) Large numbers of similarly structured data items,

all of which having essentially the same size (in bytes).

Record Orientation:

(^) Basic data items consist of (fixed-length)

records.

Small Data Items:

(^) Each record (tuple) is short – a tuple rarely

requires more than a few hundred bytes.

Atomic Fields:

(^) Fields within a tuple are short, length typically

within a specific range, first normal form holds.

Such (^) applications

(^) are (^) very (^) well (^) supported

(^) by (^) data-processing

Dr. Michael Gertzmanagement etc.)& file structures, query processing & optimization, transactionoriented data models (relational model) and concepts (storage

  1. Concepts of OODBS

ECS 165B Database Systems

-^ Non-standard applications:^ Emerging “New” Database Applications (^) On the Web:

online product catalogs, ebay, amazon.com,

e-business, e-government,...

Office (^) Information

(^) Systems

(^) and (^) Document

(^) Management

Systems

Computer-Aided Design Environments (CAD, CAM, CAQ)

Multimedia Applications (incl. images, video, audio)

Geographic

Information

Systems

(GIS),

Information

Systems,.. .Management in the Lifesciences, Environmental Information

  • Common properties and problems for these types of applications: closer^ •^ Sophisticated operations on data structures necessary, muchinstead of just declarative support) and access structures.^ •^ Novel methods for querying (navigational/operational support^ •^ Support of abstract data types (ADTs) and data encapsulationand numbers)^ Need for complex data types and type systems (not just strings

on programming

concepts

in OO programming

languages.

Dr. Michael Gertz

  1. Concepts of OODBS

ECS 165B Database Systems

3

-^ Overview of Object-Oriented Concepts and OO Data Model (^) OODBS

concepts

have

their

origin

in object-oriented

informationprogramming languages (abstract data types, encapsulation,

hiding,

methods,

class/type

hierarchies,

inheritance... )

Object

(^) ˆ= (^) state (value) and behavior (operations)

object-oriented programming languages)In OODBs objects are persistent (comp. transient objects in

logical model (like ER model)From a DB design perspective, the object-oriented model is a

(but many issues are missing in the ER model, e.g., methods)Essentially, an object corresponds to an entity in the ER model

-^ Object-Identity

  • (^) OIDsimmutable.of variables or definitions of methods change, i.e., OIDs are • (^) Object retains identifier even if some or all of the valuesobject stored in DB; used to manage inter-object references (^) OO database systems provide unique identifier (OID) for each

(^) are (^) not (^) based

(^) on (^) physical

(^) representation/storage

(^) of

object (i.e.,

(^) ROWID or TID)

Dr. Michael Gertz

  1. Concepts of OODBS

ECS 165B Database Systems

Object-identity

(^) is (^) a (^) stronger

(^) notion

(^) of (^) identity

(^) than

(^) in

(orientationprogramming languages or data models not based on object- (^) concept does not apply to tuples of a relational database)

complex object has an OID.Some OO models require that everything from simple value to

Object identifiers

(^) are used to uniquely identify objects

stored as a field of an object

Used to refer to another object, e.g., the

(^) spouse

(^) field of

a person

(^) object may be the identifier of another

(^) person

object

external (user-supplied)can be system generated (built-in; created by the DBS) or

be constructed from other objects (or other values) using In OODBS, the state (current value) of a complex object may Object Structure

(^) type

constructors

Basic type constructors are

(^) atom, tuple

, and (^) set ; can also

include

(^) list, bag

, and (^) array .

Formal representation of an object as a triple

(^) (i, c, v

), with

(^) i

being OID,

(^) c (^) a type constructor, and

(^) v (^) is the object state.

Dr. Michael Gertz

  1. Concepts of OODBS

ECS 165B Database Systems

7

  • all structures are visible and modifications are generic.OO programming languages. In contrast, in the relational model,^ Encapsulation and information hiding are core characteristics of^ Specifying Object Behavior via Class Operations
  • (^) Internalthat can be applied to objects of that type (^) Behavior of a type (class) of object is based on operations

(^) structure

(^) of (^) object

(^) is (^) hidden

(^) and (^) object

(^) is (^) only

accessible through defined operations;

(^) these include object

constructor and destructor,

(^) object modifiers,

(^) and retrieval

operations.

Part of operation visible to the user is called

(^) interface

(^) (or

signature

); implementation of an operation is called

(^) method

Method

is invoked

by sending

a message

(including

parameters)

(^) to (^) object

(^) to (^) execute

(^) corresponding

(^) method;

purpose programming language.method returns value; methods are typically written in general-

object, i.e., how a method is realized.Only the implementor can see physical implementation of

Formally, all access

Practically, complete encapsulation is too stringentaccess methods for each attribute is required).operations to an object need to be encapsulated (i.e., set and (^) divide structure of object into

(^) hidden

(^) and (^) visible

(^) attributes.

Dr. Michael Gertz

  1. Concepts of OODBS

ECS 165B Database Systems

define class DepartmentExample of class definition extending type definition type tuple (fname:

string;

operations (no_of_emps:

integer;

create_dept:

Department;

destroy_dept:

boolean;

assign_emp(e: Employee): boolean);

-^ Object Persistence via Naming and Reachability In are stored in DB and persist after program termination.are destroyed after program termination); persistent objects^ In OO programming languages, objects are transient (i.e., they (^) practice,

(^) it (^) is (^) reasonable

(^) to (^) have

(^) both

(^) transient

(^) and

persistent objects in application programs

  • Mechanisms for making an object persistent: Naming:

(^) persistent object is specified via specific statement

or operation in program; persistent objects are used as

(^) entry

points (^) into the DB. However, it is not practical to explicitly

practical mechanism isgive persistent names to all objects in DB. Thus, a more

Reachability:

object

(^) is (^) persistent

(^) by (^) reachability

(^) if (^) a

sequence

(^) of (^) references

(^) in (^) the (^) object

(^) graph

(^) leads

(^) to (^) a

persistent (named) object.

Dr. Michael Gertz

  1. Concepts of OODBS

ECS 165B Database Systems

9

type^ define class DepartmentSetExample

( set(Department));

operations ( add_dept(d: Department):

boolean;

create_dept_set:remove_dept(d: Department): boolean;

DepartmentSet;

destroy_dept_set:

boolean);

b := AllDepartments.add_dept(d);....d := Department.create_dept;....persistent name AllDepartments: DepartmentSet;

-^ Type Hierarchies and Inheritance (^) A (^) major

(^) characteristics

(^) of (^) OODBMS

(^) is (^) to (^) support

(^) the

leading todefinition of new types based on other (predefined) types,

(^) type (^) (or (^) class ) (^) hierarchies

Recallan already defined type (class);create a new type (class) that is similar but not identical toConcept of subtype (subclass) is useful when designer has to (^) is-a (^) relationship type and subclass/superclass concepts

in ER model (

ECS 165A).

Dr. Michael Gertz

  1. Concepts of OODBS

ECS 165B Database Systems

type.Subtype inherits all attributes and operations of predefined

STUDENT subtype-of PERSON: major, gpa EMPLOYEE subtype-of PERSON: salary, hiredate, job Subclasses PERSON: name, address, birthdate, age, ssnExample:

Substitutability

(^) – any method of a superclass can be invoked

equally with any object belonging to any of its subclasses

  • Multiple Inheritance more than one superclass.acyclic graph (DAG) – in such a graph, a class can haveThe class/subclass relationship is represented by a directed

A

class (^) inherits

(^) attributes

(^) and (^) methods

(^) from

(^) all (^) its

superclasses.

Potential for ambiguity,

(^) e.g., (^) attributes with the same

name. (^) Different solutions, such as flag and error, rename

attribute, or choose one.

One can use multiple inheritance to model

(^) roles (^) of an

object.

Dr. Michael Gertz

  1. Concepts of OODBS

ECS 165B Database Systems

13

interface Example:

(^) Employee

( (^) extent EmployeeExtension

keys (^) EmployeeId, (name, DOB) )

attribute Long

(^) EmployeeId;

attribute Struct

(^) Name

(^) {

String

(^) FirstName,

String

(^) LastName

(^) name;

attribute Struct

(^) Address

(^) address;

attribute List

String

(^) phones;

attribute Date DOB

attribute Short Salary

relationship List

Project

(^) participates in

inverse

(^) Project::members;

void (^) raise Salary (

in Short

(^) amount);

-^ Object Query Language (OQL)^ }; Extensions^ Syntactic and semantic extension of the SQL-92 standard.

(^) concern

(^) object-oriented

(^) notions,

like (^) complex

etc.objects, object identity, path expressions, operation invocation

Dr. Michael Gertz

  1. Concepts of OODBS

ECS 165B Database Systems

but is not restricted to this collection construct.OQL provides high level constructs to deal with sets of objects

It also

provides primitives to deal with structures, list, arrays etc.

composed, as long as the operands respect the type system.OQL is a functional language where operators can freely be

invokes operations defined on objects for that purpose.OQL does not provide explicit update operators but rather

-^ Examples: select distinct struct^ Complex result type can be constructed in query:

(e.name, projects:(

select

(^) p.projectId

from (^) e.participates in prj

(^) as (^) p) )

from (^) employee as e

setResult type: < struct

< name:String, projects:set

string

selectQuery can include path expressions:

(^) m.name

from ( select

(^) p.manager

from (^) project as p

where

(^) p.status = ’closed’)

(^) as (^) m

where

(^) m.salary

Dr. Michael Gertz

  1. Concepts of OODBS

ECS 165B Database Systems Development Strategies for OODBMS

structural

programming language

OODBMS

based OODBMS

new OODBMS

DBMS

OOPS

concepts+ database

concepts

(^1)

2

3

  • object−oriented
  • : support of important database concepts, evolution insteadformer Informix Dynamic Server with Universal Data Option), Oracle8i/9i/10g, DB2 Universal Database (includes portions ofObject-Relational DBMS of revolution, easy migration
  • : no declarative query language, views, access path support,+ : only one language for database + application programmingGemStone, ObjectStore, ONTOS, POET, Versant security, integrity constraints
  • : Combination of both approaches, new object-oriented“Pure” Object-Oriented Database Management Systems: data model
  • : difficult to learn, migration of existing applications, compatibility

Dr. Michael Gertz

  1. Concepts of OODBS