




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Typology: Lecture notes
1 / 8
This page cannot be seen from the preview
Don't miss anything!





ECS 165B Database Systems
1
Reading:
(^) Chapter 8 (4th ed), Chapter 9 (5th ed)
-^ Topics:
(^) 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
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
Information
Systems,.. .Management in the Lifesciences, Environmental Information
on programming
concepts
in OO programming
languages.
Dr. Michael Gertz
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
(^) are (^) not (^) based
(^) on (^) physical
(^) representation/storage
(^) of
object (i.e.,
(^) ROWID or TID)
Dr. Michael Gertz
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
ECS 165B Database Systems
7
(^) 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
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
(^) 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
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 (
Dr. Michael Gertz
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
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
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
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
ECS 165B Database Systems Development Strategies for OODBMS
structural
programming language
OODBMS
based OODBMS
new OODBMS
DBMS
OOPS
concepts+ database
concepts
(^1)
2
3
Dr. Michael Gertz