Onject-oriented Database Prof. Sin-Min Lee Department of Computer Science.

Slides:



Advertisements
Similar presentations
Limitations of the relational model 1. 2 Overview application areas for which the relational model is inadequate - reasons drawbacks of relational DBMSs.
Advertisements

OO databases 1 Object Oriented databases. OO databases 2 Developing OODBMS - motivation motivation more and more application areas require systems that.
Chapter 10: Designing Databases
1 Chapter 25 Introduction to Object DBMSs Transparencies © Pearson Education Limited 1995, 2005.
Introduction to Databases
ODMG Standard: Object Model1 OBJECT-ORIENTED DATABASE SYSTEMS ODMG Standard: Object Model Susan D. Urban and Suzanne W. Dietrich Department of Computer.
Classes and Object- Oriented... tMyn1 Classes and Object-Oriented Programming The essence of object-oriented programming is that you write programs in.
Object-Oriented Databases v OO systems associated with – graphical user interface (GUI) – powerful modeling techniques – advanced data management capabilities.
Chapter Object-Oriented Practices. Agenda Object-Oriented Concepts Terminology Object-Oriented Modeling Tips Object-Oriented Data Models and DBMSs.
OBJECTS Object Oriented ???????. OBJECTS Object-Oriented n OO convenient label for a collection of interconnected ideas n OO approach views computer.
Object Oriented System Development with VB .NET
File Systems and Databases
Object-Oriented Databases
Introduction to Databases Transparencies
Introduction to Object DBMSs Transparencies © Pearson Education Limited 1995, 2005.
Oracle Database Administration
Lecture 13: Object- Oriented Concepts Anita S. Malik Adapted from Schach (2004) Chapter 7.
Object Oriented Databases - Overview
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 11 Object and Object- Relational Databases.
Sharif University of Technology Session # 7.  Contents  Systems Analysis and Design  Planning the approach  Asking questions and collecting data 
C++ fundamentals.
RIZWAN REHMAN, CCS, DU. Advantages of ORDBMSs  The main advantages of extending the relational data model come from reuse and sharing.  Reuse comes.
Chapter 4 Object and Object-Relational Databases (Part ½: Object-Oriented Concepts) Lecturer: H.Ben Othmen Department of Computer Science, Umm Al-Qura.
EER vs. UML Terminology EER Diagram Entity Type Entity Attribute
Advanced Database CS-426 Week 2 – Logic Query Languages, Object Model.
Comparison of OO Programming Languages © Jason Voegele, 2003.
Chapter 24 Introduction to Object DBMSs Prepared by Kai Huang CS157B Prof Sin-Min Lee.
Information storage: Introduction of database 10/7/2004 Xiangming Mu.
Part 3: Introduction to Object DBMSs
Introduction to Object-oriented programming and software development Lecture 1.
11 1 Object oriented DB (not in book) Database Systems: Design, Implementation, & Management, 6 th Edition, Rob & Coronel Learning objectives: What.
1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.
Object-Oriented Database Management Systems (ODBMS)
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
Database Management System Prepared by Dr. Ahmed El-Ragal Reviewed & Presented By Mr. Mahmoud Rafeek Alfarra College Of Science & Technology Khan younis.
Object Orientation and Its Benefits
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
11 1 Chapter 11 Object Oriented Databases Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
Chapter 1 Object-oriented DBMSs Chapters in Textbook.
OOP Class Lawrence D’Antonio Lecture 3 An Overview of C++
Chapter 12: Designing Databases
Chapter 11 Object-Oriented DBMSs Chapter 27, 28 & Appendix K in Textbook.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 13 (Online): Object-Oriented Data Modeling Modern Database Management 10 th Edition.
Object_Oriented Databases, by Dr. Khalil 1 Object-Oriented Databases Dr. Awad Khalil Computer Science Department AUC.
Lecture # 3 & 4 Chapter # 2 Database System Concepts and Architecture Muhammad Emran Database Systems 1.
DataBase Management System What is DBMS Purpose of DBMS Data Abstraction Data Definition Language Data Manipulation Language Data Models Data Keys Relationships.
1 CS457 Object-Oriented Databases Chapters as reference.
ITEC 3220A Using and Designing Database Systems Instructor: Prof Z. Yang Course Website: 3220a.htm
ITEC 3220A Using and Designing Database Systems Instructor: Gordon Turpin Course Website: Office: CSEB3020.
Object Oriented Database By Ashish Kaul References from Professor Lee’s presentations and the Web.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Chapter 18 Object Database Management Systems. Outline Motivation for object database management Object-oriented principles Architectures for object database.
The Object-Oriented Database System Manifesto Malcolm Atkinson, François Bancilhon, David deWitt, Klaus Dittrich, David Maier, Stanley Zdonik DOOD'89,
Chapter 20 Concepts for Object-Oriented Databases Copyright © 2004 Pearson Education, Inc.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Chapter 12 Outline Overview of Object Database Concepts Object-Relational Features Object Database.
1 10 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 10 Designing Databases.
OODBMS and ORDBMS. Background Object-oriented software, based on the principles of user-defined datatypes, along with inheritance and polymorphism, is.
Data Models. 2 The Importance of Data Models Data models –Relatively simple representations, usually graphical, of complex real-world data structures.
Introduction to DBMS Purpose of Database Systems View of Data
The Object-Oriented Database System Manifesto
Object-Oriented Database Management System (ODBMS)
Chapter 12 Outline Overview of Object Database Concepts
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Database System Concepts and Architecture.
Compiled from Connelly et al. DBMS Text
File Systems and Databases
ISC321 Database Systems I Chapter 10: Object and Object-Relational Databases: Concepts, Models, Languages, and Standards Spring 2015 Dr. Abdullah Almutairi.
Chapter 20 Object-Oriented Analysis and Design
Introduction to DBMS Purpose of Database Systems View of Data
ITEC 3220A Using and Designing Database Systems
Presentation transcript:

Onject-oriented Database Prof. Sin-Min Lee Department of Computer Science

History of data models:

Weaknesses of RDBMSs Poor Representation of “Real World” Entities – Normalization leads to relations that do not correspond to entities in “real world”. Semantic Overloading – Relational model has only one construct for representing data and data relationships: the relation. – Relational model is semantically overloaded. Poor Support for Integrity and Enterprise Constraints Homogeneous Data Structure – Relational model assumes both horizontal and vertical homogeneity. – Many RDBMSs now allow Binary Large Objects (BLOBs). Limited Operations – RDBMs only have a fixed set of operations which cannot be extended.

Weaknesses of RDBMSs Difficulty Handling Recursive Queries – Extremely difficult to produce recursive queries. – Extension proposed to relational algebra to handle this type of query is unary transitive (recursive) closure operation. Impedance Mismatch – Most DMLs lack computational completeness. – To overcome this, SQL can be embedded in a high-level 3GL. – This produces an impedance mismatch - mixing different programming paradigms. 30% of programming effort and code space is expended on this type of conversion. Other Problems with RDBMSs – Transactions are generally short-lived and concurrency control protocols not suited for long-lived transactions. – Schema changes are difficult. – RDBMSs are poor at navigational access.

Object-Oriented Concepts Object-oriented concepts To start with, a brief review of underlying themes… Abstraction: Process of identifying essential aspects of an entity and ignoring unimportant properties. - Concentrate on what an object is and what it does, before deciding how to implement it. Encapsulation: Object contains both data structure and set of operations used to manipulate it. Information Hiding: Separate external aspects of an object from its internal details, which are hidden from outside. – Allows internal details of object to be changed without affecting apps that use it, provided external details remain same. – Provides data independence.

Object-Oriented Concepts Objects and Attributes Object: Uniquely identifiable entity that contains both the attributes that describe the state of a real-world object and the actions associated with it. – Definition very similar to ‘entity’, however, object encapsulates both state and behavior; – an entity only models state. Attribute: Contain current state of an object. Attributes can be classified as simple or complex. Simple attribute can be a primitive type such as integer, string, etc., which takes on literal values. Complex attribute can contain collections and/or references. Reference attribute represents relationship. complex object: contains one or more complex atts

Object-Oriented Concepts Object Identity Object identifier (OID) assigned to object when it is created that is: – System-generated. – Unique to that object. – Invariant. – Independent of the values of its attributes (that is, its state). – Invisible to the user (ideally). Advantages: They are efficient. They are fast. They cannot be modified by the user. They are independent of content. - RDBMS: object identity is value-based, primary key provides uniqueness. - Primary keys do not provide type of object identity required in OO systems: –key only unique within a relation, not across entire system –key chosen from atts of relation, making it dependent on object state.

Object-Oriented Concepts Methods and messages Method: Defines behavior of an object, as a set of encapsulated functions. Message: Request from one object to another asking second object to execute one of its methods. (a) (b) (a) Object showing atts and methods (b) Example of a method

Object-Oriented Concepts Classes Class: Blueprint for defining a set of similar objects. -Objects in a class are called instances. -Class is also an object with own class attributes and class methods.

Object-Oriented Concepts Subclasses, Superclasses and inheritance Inheritance allows one class of objects to be defined as a special case of a more general class. Special cases are subclasses and more general cases are superclasses. Generalization: process of forming a superclass Specialization: forming a subclass Subclass inherits all properties of its superclass and can define its own unique properties. Subclass can redefine inherited methods. All instances of subclass are instances of superclass. Principle of substitutability: instance of subclass can be used whenever method/construct expects instance of superclass. A KIND OF (AKO): Name for relationship between subclass and superclass 4 Types of inheritance: 1. single 2. multiple 3. repeated 4. selective

Types of inheritance (a) (b) (c) (a) Single (b) Multiple (c) Repeated (b)

Overriding and overloading Overriding: Process of redefining a property within a subclass. Overloading: Allows name of a method to be reused with a class or across classes. Overriding Example: Might define method in Staff class to increment salary based on commission method void giveCommission(float branchProfit) { salary = salary * branchProfit; } May wish to perform different calculation for commission in Manager subclass: method void giveCommission(float branchProfit) { salary = salary * branchProfit; }

Polymorphism and dynamic binding Polymorphism: Means ‘many forms’. Three types: 1. operation 2. Inclusion 3. parametric. Dynamic Binding: Runtime process of selecting appropriate method based on an object’s type. Example: With list consisting of an arbitrary no. of objects from the Staff hierarchy, we can write:list[i]. print and runtime system will determine which print() method to invoke depending on the object’s (sub)type.

Complex Objects Complex Objects: An object that consists of subobjects but is viewed as a single object. Contained object can be encapsulated within complex object, accessed by complex object’s methods. Or have its own independent existence, and only an OID is stored in complex object. Objects participate in a A-PART-OF (APO) relationship.

Storing objects in relational databases Storing Objects in Relational Databases One approach to achieving persistence with an OOPL is to use an RDBMS as the underlying storage engine. Requires mapping class instances (i.e. objects) to one or more tuples distributed over one or more relations. To handle class hierarchy, have two basics tasks to perform: (1)design relations to represent class hierarchy; (2)design how objects will be accessed.

Storing objects in relational databases Storing Objects in Relational Databases Sample inheritance hierachy for staff

Storing objects in relational databases Mapping classes to relations No. of strategies for mapping classes to relations, although each results in a loss of semantic information. 1.Map each class or subclass to a relation: Staff (staffNo, fName, lName, position, sex, DOB, salary) Manager (staffNo, bonus, mgrStartDate) SalesPersonnel (staffNo, salesArea, carAllowance) 2.Map each subclass to a relation Manager (staffNo, fName, lName, position, sex, DOB, salary, bonus, mgrStartDate) SalesPersonnel (staffNo, fName, lName, position, sex, DOB, salary, salesArea, carAllowance) 3. Map the hierarchy to a single relation Staff (staffNo, fName, lName, position, sex, DOB, salary, bonus, mgrStartDate, salesArea, carAllowance, typingSpeed, typeFlag)

Next Generation Database Systems First Generation DBMS: Network and Hierarchical –Required complex programs for even simple queries. –Minimal data independence. –No widely accepted theoretical foundation. Second Generation DBMS: Relational DBMS –Helped overcome these problems. Third Generation DBMS: OODBMS and ORDBMS.

Object-oriented databases Object-oriented database = a database constructed by applying the object-oriented paradigm – Each data entity stored as a persistent object – Relationships indicated by links between objects – DBMS maintains inter-object links

The associations between objects in an object-oriented database

OODB Some people felt the word object-oriented is too close to OOPL ODB is more generic

Different approaches to designing ODB 1. Applications written in extension of existing OOPL (1st generation OODB) language, compiler, execution environment, etc. extended to incorporate – DB functionality – store and manage objects created by OOPL Selling point - unified programming and DB language but need query optimization, etc. – Gemstone (Smalltalk), Poet (C++)

Designing cont’d 2. Extend relational DB to include OO features: OID, type hierarchy, inheritance, encapsulation, arbitrary data types, nested objects, etc. Already familiar with DBMS but performance decreased Postgres - extended Ingres, Oracle

Designing cont’d 3. Start entire process from scratch (next generation?) unify relational and OO system

Object Data Model Bring concepts of OOPL into DB systems – Object corresponds to real-world object – Object is data and behavior, object has attributes and operations – Data object has OID - immutable – Group data objects into classes - abstract mechanism, share same structure and behavior

ODM Class has: – instances – methods and data - encapsulation for information hiding - access only through methods – composite classes - composed of multiple types – nested objects - contains another object – complex objects - set of objects – class hierarachy (ISA) – specialization - define new classes from existing ones – inheritance of attributes and methods - reuse

ODM Completeness DBS needs to be computationally complete (Turing) SQL not computationally complete - unless embedded SQL - impedance mismatch, since sets connections with DML and OOPL in ODB more acceptable

ODM Add features such as: – concurrency – recovery – schema evolution – Versions – What about query language? – Performance?

ODM Object identity OID correspondence between real-world and database objects used to refer to objects in application programs and in references between objects (relationships) unique identity to each independent object

OID vs. primary key identity based vs. value-based unique over entire DB and even over distributed DB (if primary key changes, still same real-world object) immutable - values of OID for object should not change - OID not assigned to another object - not dependent on any attribute values - not use physical address system generated OID not visible to user

Advantages of object-oriented databases Matches design paradigm of object-oriented applications Intelligence can be built into attribute handlers – Example: names of people Can handle exotic data types – Example: multimedia Can store intelligent entities

Desires of the software industry More functionality Less code Reduced internal complexity Standard interfaces Reduced duplication of effort

Hope with Objects Objects have been shown to satisfy all five of these desires…

Objects satisfy desires… Development effort is reduced – 2 to 1 reductions are common – 5 to 1 frequent – 20 to 1 possible with relevant libraries Continued…

Objects satisfy desires Projects tend to meet specs 3 to 1 reduction in control flow complexity Messages allow clean interfaces Objects promote reusability (6 to 1)

Traditional Development Real World Design Implementation model developed by designers gets lost in implementation

Developing with Objects Real WorldDesign Implementation Design and implementation model directly reflect real world Design remains visible in source code

Code Reuse Statistics ProjectTotal Code New Code % ReuseSavings HPMS3,926K1,960K50%$117,000 OSA1,950K327K83%$119,000 SPC1,815K130K92%$248,000 Profit1,940K412K78%$80,000

Benefits: Reuse

Benefits: Bulk Reduction

Benefits: Quality Improvement

Objects in a Nutshell… 1. Objects encapsulate data within the set of procedures which can access that data. 2. Programming is done by requesting an object to perform some desired behavior.

Objects in a Nutshell… 3. Objects determine at run-time the particular procedure to execute in response to a request. 4. Objects are grouped into classes which describe the common structure and behavior of that class of objects.

Objects in a Nutshell 5. Classes are organized hierarchically in order to factor out generic capabilities; thus, eliminating redundancy. 6. Programmers no longer write programs; they develop models of their application or system environment using classes.

Objects Encapsulate Data message procedures procedures Objects encapsulate their local data within procedures which have access to that data data

Instances Every object is an instance of a generic class of objects An instance describes a single concept or models a real world entity

Classes of Objects A class contains – Class’ data template – Class’ available procedures

Relating an Object to its Class inherits from ObjectClass name Unique Data Values Data Templates + Procedures

Dynamic Binding Objects determine at run-time which procedure to execute The cost is more modest than expected; thus viability of Smalltalk. Time critical applications can combine dynamic and static binding as required (in hybrid languages).

Objects Share Classes inherits from Object Class name Unique Data Values Data Templates + Procedures

Classes Inherit Classes A class has state information and performs predefined functions A subclass may add or alter the function or state defined in its superclass(es). Integer Number Object

Lineage of Object Languages Modula Eiffel Pascal Ada C++ C Objective-C Smalltalk/V AlgolSimulaSmalltalk Actor LispLoops CLOS

Inheritance Often shown using a hierarchy diagram Implies that integer is a subset of Number which is a subclass of the Object class Data and procedures are inherited from superclasses Object Number Integer Real

The Power of Inheritance Powerful capabilities can be developed near the root of the inheritance tree The root of the tree is the Object class which includes methods such as: size:size in bytes of any object storeOn:to store on disk copy: to make a copy of any object in memory

Features / Benefits… EncapsulationBehavior without the burden; reduces side effects Message passingIncapsulates user from the implementation InheritanceCode bulk reduction; modification by specialization continued…

Features / Benefits Dynamic binding Replaceable components; enables iterative development Classes Packaging systems into domain meaningful components Modeling language Readability of code; code reflects real world being modeled

Pure Object Environments Smalltalk-80 from ParcPlace Systems Smalltalk/V from Digitalk Actor from Whitewater Group

Objective-C A small language which allows details of C to be hidden Default is dynamic; static binding also available Interpreter and libraries are available

C++ A large but direct extension to C Default is static binding; dynamic also available Minimizes time and space

Failures with OOP Designs with too fine grained use of objects Performance – a design failure Bleeding edge – select tools carefully Memory cannot be ignored

Futures Visual programming techniques will become commonplace Objects may provide the long awaited key to effective distributed processing – enormous computing power now sits idle on desktops Object oriented databases will become commercial products in the 2000’s

Conclusions Objects will change the way software is built, sold and used Objects will take as long as semiconductors to become pervasive