Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Object-Oriented Databases n Record-oriented data models are powerful when applied to traditional database applications n However in a relational model,

Similar presentations


Presentation on theme: "1 Object-Oriented Databases n Record-oriented data models are powerful when applied to traditional database applications n However in a relational model,"— Presentation transcript:

1 1 Object-Oriented Databases n Record-oriented data models are powerful when applied to traditional database applications n However in a relational model, – data is organized as a flat tuple – the schema are relatively static – relationships among data must be explicitly specified as integrity constraints – traditional models lack functionality in supporting advanced database applications – CAD/CAM and CIM, Image and graphics, Geographic and scientific, multimedia, documents, etc. n Characteristics and requirements – complex structures of objects – new data types for unstructured data (e.g. BLOB) – reactive(endless) activities – long-duration (open-ended) activities – collaborating (cooperative) activities OO Data models and OO database systems are proposed to address these requirements

2 2 Systems and Interfaces n experimental prototypes – ORION (MCC), OpenOODB (Texas Instruments), IRIS(HP), ODE(ATT Bell Labs), ENCORE/ObServer (Brown),... n commercial OODB Systems – GEMSTONE/OPAL (Servio Logic), O2 (O2 Technology), ObjectStore (Object Design),... n OO Shells or Interfaces – Paradox, Access,..

3 3 OO Concepts n Concepts are adopted from OO programming languages n Object – is an instance of abstract data type (ADT) – hides the internal data structure (information hiding) – can be accessed and manipulated by the application using a set of operations specific to the ADT (encapsulations) – Objects in programming languages are transient l exist only during program execution – Objects in DB are persistent l they are persistent and can be shared by a number of programs n Class  collections of objects, either implicitly or explicitly specified  contain associated methods, which are algorithms specifying how the objects in that class are to be manipulated n Hierarchy  imposes an acyclic graph structure on the set of classes n an OODBS supports an interface to one or more OO programming languages providing persistent and shared object capabilities while treating transient and persistent objects uniformly n there is no single OO data model. However, there is a set of concepts that an OO data model and OODB must support

4 4 Example Hierarchies ImageWord HTML Raw text Mac IBM PC Documents Art ScienceNatural History Metropolitan New York Museums Smithsonian Baltimore Aquarium

5 5 OO Concepts (continued) n Object Identifier: a unique and immutable system-wide id (not true with relational data model) – OODB maintains a direct correspondence between real-world and database objects n Object structure can be of arbitrary complexity in order to contain all significant information (in relational the information is scattered over many relations) n instance variables – Object internal structure includes the specification of instance variables that hold its state. – instance variables could be complex objects themselves n type constructors – complex object structures can be constructed by recursively applying a set of basic type constructors such as tuple, set, list, and bag n encapsulation – complete encapsulation: only a specific set of predefined operations or functions can be applied on a particular object l assumes object independence l does not permit explicit specification of relationships between objects

6 6 Objects n An object is defined as a pair: (id, values) n Example : declare b2 values [author = John Smith, url = http://www.somewhere.com/ date_created = (15, Jan, 1999) date_last_modified = (25, Jan, 1999) n Types u Record type, Set type, List type n Examples: [author: string; url: urltype; date_created: datetype; date_last_modified: datetype] [address: string; director: string; special_exhibits: {string}; affiliated_museums: {Oid_set}]

7 7 Operations on Objects n Each operation has two parts – (1) signature or interface: specifies name and arguments of the operation (externally visible) – (2) method or body: specifies the implementation of the operation (externally invisible) n Operations can be invoked by passing a message to an object – objects' internal structure and operations' implementation can be changed without affecting the programs that access them – This provides encapsulation

8 8 Types, Class Hierarchy and Inheritance n Object type: set of allowable values n Object class: collection of objects meaningful in an application n New types and classes can be specified based on existing ones n Inheritance: new types and classes inherit much of the structure and operations from the type/class they are derived n incremental development of system data type is supported n ability to reuse existing type definitions and implementations

9 9 Object Definition Language (ODL) n Simple language within which objects and interfaces can be defined n ODL provides a formal syntax to access the signatures of the objects so that external programs wishing to access/manipulate the object using the methods provided by the object n Example : interface html:documents (extent html_documents keys url: persistent { } );

10 10 Object Query Language (OQL) n If Q is expressed in SQL, then Q is also a valid OQL query n SQL queries can access only flat relational tables n In contrast, objects may have a nested structure, as well as include fields that contain collection types - sets, lists,.. OQL facilitates access to such data types n Examples : select struct(field1:x.url, field2:x.link) from Word x where x.author = “John Smith” select y.author from (select x.link from Word x where x.author = “John Smith”) y

11 11 Object-Relational Systems n Relational databases have proved very useful in querying flat data n Is it possible to extend the relational model to handle complex data? n Yes, The resulting paradigm is object-relational n Example: u Consider a bank relation schema (Fname, Lname, AccType, Trans, Amount, Day) and a crime relation schema (SSN, FirstName, LastName, Conviction, Day) u Suppose we extended both these schemes to include images as follows: (Fname, Lname, AccType, Trans, Amount, Day, PIC) (SSN, FirstName, LastName, Conviction, Day, PIC)

12 12 Example Continued n If a customer reports that her ATM card was stolen and she did not make the last withdrawal n To verify, the bank needs to look at the surveillance image and see if it is that of the customer n If not, the next logical step for the police to perform is to attempt check if there is a match between the image in surveillance record with any image in the crime database n This needs execution of the query u “Select all tuples in the crime relation that match the image in customer record” n SQL cannot support such query directly because the comparison operator “match” is not supported by a relational database n An object db language cannot be used either because the data is not stored in an object-oriented db

13 13 Object-Relational Scheme n Object relational scheme: (A1:T1, … An:Tn) where Ai’s are attribute names and Ti’s are objects n Example: (Fname:str, Lname:str, AccType:int, Trans:tt, Amount:real, Day:date, PIC:image) (SSN:ssntype, FirstName:str, LastName:str, Conviction:str, Day:date, PIC:image) n object conditions u match(image1,image2) > 0.7; u match(image1,image2) > match(image3,image2); n Query select Fname,Lname from Crime C, Bank B where match(B.image1,C.PIC) > 0.9

14 14 Commercial Object-relational Systems n Informix u offers a variety of datablades for image db, face recognition, audio data handling, document processing, video processing, spatial db n DB2 u offers similar features called extenders n Oracle n Sybase n Uni-Sql and Ominiscience employ O-R technology


Download ppt "1 Object-Oriented Databases n Record-oriented data models are powerful when applied to traditional database applications n However in a relational model,"

Similar presentations


Ads by Google