Top Banner
OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015
56

OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

Dec 23, 2015

Download

Documents

Phebe Smith
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

OBJECT DATABASE CONCEPTS

MIS 409

John Vance

Cassidy Warren

April 23, 2015

Page 2: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

OVERVIEW

• What’s an Object?

• Benefits, Reasons for and Characteristics of Objects and ODBMS

• ODBMS Features

• ODBMS vs RDMS

• OQL vs SQL

• Extensibility

• Inheritance

Page 3: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

OVERVIEW

• Polymorphism

• Overloading

• Encapsulation

• Concurrency

• Complex Objects

• OODB’s and commercial systems

Page 4: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

WHAT’S AN OBJECT?

Objects – User defined complex data types

Two components: State (value) and behavior (operations). Similar to program variable in programming language, except that it will typically have a complex data structure

Has specific operations defined by the programmer

Page 5: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

BENEFITS OF OBJECTS

• Improve program reliability

• Simplify software maintenance

• Allows for reusability of code

• Maintain a direct correspondence between real-world and database objects

Page 6: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

REASONS FOR OO DATABASES

• Need for more complex applications

• Need for additional data modeling features

• Increased use of object-oriented programming languages

Page 7: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

CHARACTERISTICS OF AN OBJECT

An object is described by four characteristics

Identifier: a system-wide unique id for an object

Name: an object may also have a unique name in DB (optional)

Lifetime: determines if the object is persistent or transient

Structure: Construction of objects using type constructors

Page 8: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

WHAT IS AN OBJECT DATABASE?

An object database (also object-oriented database) is a database model in which information is represented in the form of objects as used in object-oriented programming.

Page 9: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

OBJECT DATABASE MGMT SYSTEM

(ODBMS)• ODBMS is a database management system (DBMS) that

supports the modeling and creation of data as objects.

• includes some kind of support for classes of objects and the inheritance of class properties and methods by

subclasses and their objects.

• Currently no widely agreed-upon standard for what constitutes an OODBMS, and OODBMS products are

considered to be still in their infancy.

• Object-relational database management system (ORDBMS) is more commonly encountered in available

products.

Page 10: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

ODBMS FEATURES

• Designer can specify the structure of objects and their behavior (methods)

• Better interaction with object-oriented languages such as Java and C++

• Definition of complex and user-defined types

• Encapsulation of operations and user-defined methods

• Query Language

• Faster Data Access because joins are often not needed

Page 11: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

ADVANTAGES OF ODBMS

• Designer can specify the structure of objects and their behavior (methods)

• Better interaction with object-oriented languages such as Java and C++

• Definition of complex and user-defined types

• Encapsulation of operations and user-defined methods

• Access to data can be faster because joins are often not needed

Page 12: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

ODBMS AND RDBMS DIFFERENCES

• 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), RDMSs appropriate for simple, “flat” data.

• 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

Page 13: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

RELATIONAL DATABASE OF A CAT

Page 14: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

OBJECT DATABASE OF A CAT

Page 15: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

SQL

• Structured Query Language, is a database computer language designed for managing data in relational database management systems (RDBMS), and originally based upon relational algebra.

Page 16: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

OQL

• Object Query Language (OQL) is a query language standard for object-oriented databases modelled after SQL.

• Declarative query language

• Not computationally complete

• Syntax based on SQL (select, from, where)

• Additional flexibility (queries with user defined operators and types)

Page 17: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

EXAMPLE OF OQL QUERY

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.

Page 18: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

RESULT OF QUERY (SQL)

Name

Ford MustangMercedes SLK

Product No. Name Color

P1 Ford Mustang Black

P2 Toyota Celica Green

P3 Mercedes SLK Black

RESULT:

- The statement queries a relational database.

=> Returns a table with rows.

Page 19: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

RESULT OF QUERY (OQL)Product No. Name Color

P1 Ford Mustang Black

P2 Toyota Celica Green

P3 Mercedes SLK Black

String String

Ford Mustang Mercedes SLK

RESULT:

- The statement queries a object-oriented database

=> Returns a collection of objects.

Page 20: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

OQL VS SQL

Key Differences Between OQL and SQL

OQL differs from SQL in that:

• OQL supports object referencing within tables. Objects can be nested within objects.

• Not all SQL keywords are supported within OQL. Keywords that are not relevant to Netcool/Precision IP have been removed from the syntax.

• OQL can perform mathematical computations within OQL statements.

Page 21: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

OQL /SQL COMPARISON

OQL SQL

ObjectCollectionNavigationFilterLink

TupleTable JoinQueryKey

Queries look very similar in SQL and OQL, sometimes they are the sameBut, the results they give are very different

Page 22: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

EXTENSIBILITY

• Ability of a software system (such as a database system) to allow and accept significant extension of its capabilities, without major rewriting of code or changes in its basic architecture

• Database extensibility is a term that refers to the ability to extend a database schema.

• Static database extensibility involves the use of predefined columns.

• Dynamic database extensibility involves adding columns to a table or creating an extension table with records that have a one-to-one relationship with records in a base table.

Page 23: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

EXTENSIBILITY (PT. 2)

• Advanced database extensibility involves creating new tables whose records have a one-to-many or a many-to-one relationship with records in a standard base table.

• Database Extensibility usually drives GUI customization, enabling System Administrators to enhance screens to display new fields to users.  Often, System Administrators can use drag-and-drop facilities to place new fields onto data entry screens, and determine the field order for both the standard and custom fields.

Page 24: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

CLASS HIERARCHY

• a classification of object types, denoting objects as the instantiations of classes inter-relating the various classes by relationships such as "inherits", "extends“.

• When a method is invoked on an object it is first looked for in the object's class, then the superclass of that class, and so on up the hierarchy until it is found.

Page 25: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

TYPE AND CLASS HIERARCHY

Page 26: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

INHERITANCE

• Inheritance is a relationship between classes where one class is the parent(base/superclass/ancestor/etc.) class of another child (subclass).

• Objects inherit attributes from parent objects.

• a way to form new classes (instances of which are called objects) using classes that have already been defined.

Page 27: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

EXAMPLE OF INHERITANCE

TYPE_NAME: function, function, …, function

Ex:

• PERSON: Name, Adress, Birthdate, Age, SSN

• TEACHER: subtype of PERSON: Salary, HireDate

• STUDENT: suptype of PERSON: Major, GPA

Page 28: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

BENEFITS OF INHERITANCE

• Overriding

• Code re-use

• One of the earliest motivations for using inheritance was the re-use of code which already existed in another class. This practice is usually called implementation inheritance.

Page 29: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

INHERITANCE CONCEPTS/TERMS

• Extents-In most OO Databases, the collection of objects in an extent have the same type or class.

• Persistant Collection- Holds a collection of objects that is stored permanently in the database and therefore can be accessed and shared by multiple programs.

• Transient Collection- exists temporarily during the execution of a program but is not kept when the program terminates

Page 30: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

TYPES OF INHERITANCE

• Multiple Inheritance

• when T is a subtype of two (or more) types, T inherits the functions (attributes and methods) of both supertypes

• Selective Inheritance

• a subtype inherits only some of the functions of a supertype

• an EXCEPT clause may be used to list the functions in a super type that are not to be inherited by the subtype

Page 31: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

MULTIPLE INHERITANCE EXAMPLE

• ENGINEERING _MANAGER would be a subtype of MANAGER and ENGINEER

• ENGINEERING_MANAGER inherits functions of BOTH supertypes, MANAGER and ENGINEER

Page 32: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

POLYMORPHISM

• Allows two methods to use the same name but have different behavior. Methods for one object can be defined, then the operation specification (methods) can be shared with other objects.

In other words:

• is the ability of one type, A, to appear as and be used like another type, B.

Page 33: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

OPERATION POLYMORPHISM

• operation name may refer to several different implementations depending on the type of object it is applied to

• several operations same name different implementation (output of function)

Page 34: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

EXAMPLE OF OVERLOADING• Print(object O)

• Print(text_object T)

• Print(image_object P)

•Print(objectO) is a method that prints.

•Print(text_objectT) is an OVERLOADED method that prints text.

•Print(image_objectP) is an OVERLOADED method that prints pictures.

Operation Specification:

Page 35: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

USES OF POLYMORPHISM

• The primary usage of polymorphism in industry is the ability of objects belonging to different types to respond to method, field, or property calls of the same name, each one according to an appropriate type-specific behavior.

• The programmer (and the program) does not have to know the exact type of the object in advance, and so the exact behavior is determined at run time (this is called late binding or dynamic binding).

Page 36: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

INHERITANCE W/ POLYMORPHISM

• Inheritance combined with polymorphism allows class B to inherit from class A without having to retain all features of class A; it can do some of the things that class A does differently.

• If a Dog is commanded to speak(), it may emit a bark, while if a Pig is asked to speak(), it may respond with an oink. Both inherit speak() from Animal, but their subclass methods override the methods of the superclass, known as overriding polymorphism. Adding a walk method to Animal would give both Pig and Dog objects the same walk method. (Different speak, same walk method)

Page 37: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

OVERRIDING

• allows a subclass to provide a specific implementation of a method that is already provided by one of its superclasses. The implementation in the subclass overrides (replaces) the implementation in the superclass.

• Subclass OVERRIDES Superclass

Page 38: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

AGGREGATION

• Aggregation is an abstraction through which relationships are treated as higher-level entities. It is an increasingly important operation in today’s relational database management systems.

• Aggregation processing in today’s database management systems closely resembles the batch processing of the 1960’s.

Page 39: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

AGGREGATION EXAMPLE

• A small business needs to keep track of its computer systems. They want to recorded information such as model and serial number for each system and its components.

Page 40: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

INCORRECT MODEL (WITH IMPROVEMENT)

• The incorrect model puts all the information into a single class type. This class contains a set of repeated attributes.

• The improved model will accommodate the addition of more types of components (a scanner, perhaps), a system with more than one monitor or printer, or a replacement component on the shelf that don’t belong to any system right now.

Page 41: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

BETTER MODEL (WITH UML AGGREGATION)

UML allows us to show the association in a more semantically correct way. The system is an aggregation of components. In UML, aggregation is shown by an open diamond on the end of the association line that points to the parent (aggregated) class. There is an implied multiplicity on this end of 0..1, with multiplicity of the other end shown in the diagram as usual. To describe this association, we would say that each system is composed of one or more components and each component is part of zero or one system.

Page 42: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

ENCAPSULATION

• An attribute of object design.

• All the data is contained and hidden in the object.

• Can also be defined as the “internal representation of an object.”

• Typical keywords of languages such as Java & C++ (public & private)

Page 43: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

ENCAPSULATION EXAMPLE

Page 44: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

CONCURRENCY

• A property of computers where multiple things are done at once.

• Time-Shared threads or physical separate processors.

• Used in many mathematical model designs and computations.

• Programming practices and comparisons to parallel programming

Page 45: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

CONCURRENCY IN DATABASES

• Database concurrency controls ensure that transactions occur in an ordered fashion.

• Main job of these controls is to protect transactions issued by different users/applications from the effects of each other.

• Must preserve the four characteristics of database transactions: atomicity, isolation, consistency and durability.

Page 46: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

FOUR CHARACTERISTICS (ACID)

• Atomicy – success or failure

• Isolation – processes or transactions cannot interfere with one another

• Consistency – ensuring that a transaction maintains integrity during execution

• Durability – ability to survive crashes

Page 47: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

COMPLEX OBJECTS

• Simple objects + constructors.

• Simple objects include integers, characters, byte strings, and booleans.

• Examples: arrays and lists.

Page 48: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

OBJECT ORIENTED DATABASE MANAGEMENT SYSTEMS

• Object Store

• O2

• Gemstone

• Versant

• Ontos

• DB/Explorer ODBMS

• Poet

• Objectivity /DB

• EyeDB

• Ozone

• Zope

• FramerD

Page 49: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

ORACLE OBJECTSAbout Oracle Objects

Advantages of Objects

Page 50: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

ABOUT ORACLE OBJECTS

• User-defined types that make it possible to model real-world entities

• New Object Types built from:

• Previously created object types

• Object references

• Collect types

Page 51: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

MORE ABOUT ORACLE OBJECTS

• Oracle objects can work with complex data

• Images

• Audio

• Video

Page 52: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

ADVANTAGES OF ORACLE OBJECTS…

• Like raw databases, data is stored in rows in columns but the interaction with database is with objects and entities that you have created

• Objects Can Encapsulate Operations Along with Data

• Efficiency

• Represent Part-Whole Relationships

Page 53: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

CURRENTLY USING OODBMS TO HANDLE CRITICAL DATA

• Chicago Stock Exchange via Versant

• Radio Computing Services, the largest radio software company in the world

• Large Hadron Collider at CERN

• Stanford Linear Accelerator Center

• Ajou University Medical Center in South Korea

Page 54: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

SUMMARY

• OODBMS store information as objects, unlike Relational databases that are table-oriented

• OODBMS store complex data without mapping relational rows and columns

• OQL vs SQL

• OODBMS allow for more complex applications

Page 55: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

SUMMARY

• What’s an Object?

• Benefits, Reasons for and Characteristics of Objects and ODBMS

• ODBMS Features

• ODBMS vs RDMS

• OQL vs SQL

• Extensibility

• Inheritance

Page 56: OBJECT DATABASE CONCEPTS MIS 409 John Vance Cassidy Warren April 23, 2015.

SUMMARY

• Polymorphism

• Overloading

• Encapsulation

• Concurrency

• Complex Objects

• OODB’s and commercial systems