Advance Database Management Systems : 15
Object Data Management Group (ODMG)
Prof Neeraj Bhargava
Vaibhav Khanna
Department of Computer Science
School of Engineering and Systems Sciences
Maharshi Dayanand Saraswati University Ajmer
Slide 21- 2
Objectives
• Discuss the importance of standards (e.g.,
portability, interoperability)
• Introduce Object Data Management Group
(ODMG): object model, object definition
language (ODL), object query language (OQL)
• Present ODMG object binding to programming
languages (e.g., C++)
• Present Object Database Conceptual Design
Slide 21- 3
The Object Model of ODMG
• Provides a standard model for object
databases
• Supports object definition via ODL
• Supports object querying via OQL
• Supports a variety of data types and type
constructors
Slide 21- 4
ODMG Objects and Literals
• The basic building blocks of the object model are
– Objects
– Literals
• An object has four characteristics
1. Identifier: unique system-wide identifier
2. Name: unique within a particular database and/or program; it
is optional
3. Lifetime: persistent vs. transient
4. Structure: specifies how object is constructed by the type
constructor and whether it is an atomic object
Slide 21- 5
ODMG Literals
• A literal has a current value but not an
identifier
• Three types of literals
1. atomic: predefined; basic data type values (e.g.,
short, float, boolean, char)
2. structured: values that are constructed by type
constructors (e.g., date, struct variables)
3. collection: a collection (e.g., array) of values or
objects
Slide 21- 6
ODMG Interface Definition:
An Example
• Note: interface is ODMG’s keyword for class/type
interface Date:Object {
enum weekday{sun,mon,tue,wed,thu,fri,sat};
enum Month{jan,feb,mar,…,dec};
unsigned short year();
unsigned short month();
unsigned short day();
…
boolean is_equal(in Date other_date);
};
Slide 21- 7
Built-in Interfaces for
Collection Objects
• A collection object inherits the basic
collection interface, for example:
– cardinality()
– is_empty()
– insert_element()
– remove_element()
– contains_element()
– create_iterator()
Slide 21- 8
Collection Types
• Collection objects are further specialized into
types like a set, list, bag, array, and dictionary
• Each collection type may provide additional
interfaces, for example, a set provides:
– create_union()
– create_difference()
– is_subset_of(
– is_superset_of()
– is_proper_subset_of()
Slide 21- 9
Object Inheritance Hierarchy
Slide 21- 10
Atomic Objects
• Atomic objects are user-defined objects and are defined via
keyword class
• An example:
class Employee (extent all_emplyees key ssn)
{
attribute string name;
attribute string ssn;
attribute short age;
relationship Dept works_for;
void reassign(in string new_name);
}
Slide 21- 11
Class Extents
• An ODMG object can have an extent
defined via a class declaration
– Each extent is given a name and will contain all
persistent objects of that class
– For Employee class, for example, the extent is
called all_employees
– This is similar to creating an object of type
Set<Employee> and making it persistent
Slide 21- 12
Class Key
• A class key consists of one or more unique
attributes
• For the Employee class, the key is ssn
– Thus each employee is expected to have a unique
ssn
• Keys can be composite, e.g.,
– (key dnumber, dname)
Slide 21- 13
Object Factory
• An object factory is used to generate individual
objects via its operations
• An example:
interface ObjectFactory {
Object new ();
};
• new() returns new objects with an object_id
• One can create their own factory interface by
inheriting the above interface
Slide 21- 14
Interface and Class Definition
• ODMG supports two concepts for specifying
object types:
– Interface
– Class
• There are similarities and differences between
interfaces and classes
• Both have behaviors (operations) and state
(attributes and relationships)
Slide 21- 15
ODMG Interface
• An interface is a specification of the abstract
behavior of an object type
– State properties of an interface (i.e., its attributes
and relationships) cannot be inherited from
– Objects cannot be instantiated from an interface
Slide 21- 16
ODMG Class
• A class is a specification of abstract behavior
and state of an object type
– A class is Instantiable
– Supports “extends” inheritance to allow both
state and behavior inheritance among classes
– Multiple inheritance via “extends” is not allowed
Assignment
• What do you understand by collection object.
Give example of some interfaces related to
collection objects.
• Explain the concept of interface and class on
OODBMS

Adbms 15 object data management group

  • 1.
    Advance Database ManagementSystems : 15 Object Data Management Group (ODMG) Prof Neeraj Bhargava Vaibhav Khanna Department of Computer Science School of Engineering and Systems Sciences Maharshi Dayanand Saraswati University Ajmer
  • 2.
    Slide 21- 2 Objectives •Discuss the importance of standards (e.g., portability, interoperability) • Introduce Object Data Management Group (ODMG): object model, object definition language (ODL), object query language (OQL) • Present ODMG object binding to programming languages (e.g., C++) • Present Object Database Conceptual Design
  • 3.
    Slide 21- 3 TheObject Model of ODMG • Provides a standard model for object databases • Supports object definition via ODL • Supports object querying via OQL • Supports a variety of data types and type constructors
  • 4.
    Slide 21- 4 ODMGObjects and Literals • The basic building blocks of the object model are – Objects – Literals • An object has four characteristics 1. Identifier: unique system-wide identifier 2. Name: unique within a particular database and/or program; it is optional 3. Lifetime: persistent vs. transient 4. Structure: specifies how object is constructed by the type constructor and whether it is an atomic object
  • 5.
    Slide 21- 5 ODMGLiterals • A literal has a current value but not an identifier • Three types of literals 1. atomic: predefined; basic data type values (e.g., short, float, boolean, char) 2. structured: values that are constructed by type constructors (e.g., date, struct variables) 3. collection: a collection (e.g., array) of values or objects
  • 6.
    Slide 21- 6 ODMGInterface Definition: An Example • Note: interface is ODMG’s keyword for class/type interface Date:Object { enum weekday{sun,mon,tue,wed,thu,fri,sat}; enum Month{jan,feb,mar,…,dec}; unsigned short year(); unsigned short month(); unsigned short day(); … boolean is_equal(in Date other_date); };
  • 7.
    Slide 21- 7 Built-inInterfaces for Collection Objects • A collection object inherits the basic collection interface, for example: – cardinality() – is_empty() – insert_element() – remove_element() – contains_element() – create_iterator()
  • 8.
    Slide 21- 8 CollectionTypes • Collection objects are further specialized into types like a set, list, bag, array, and dictionary • Each collection type may provide additional interfaces, for example, a set provides: – create_union() – create_difference() – is_subset_of( – is_superset_of() – is_proper_subset_of()
  • 9.
    Slide 21- 9 ObjectInheritance Hierarchy
  • 10.
    Slide 21- 10 AtomicObjects • Atomic objects are user-defined objects and are defined via keyword class • An example: class Employee (extent all_emplyees key ssn) { attribute string name; attribute string ssn; attribute short age; relationship Dept works_for; void reassign(in string new_name); }
  • 11.
    Slide 21- 11 ClassExtents • An ODMG object can have an extent defined via a class declaration – Each extent is given a name and will contain all persistent objects of that class – For Employee class, for example, the extent is called all_employees – This is similar to creating an object of type Set<Employee> and making it persistent
  • 12.
    Slide 21- 12 ClassKey • A class key consists of one or more unique attributes • For the Employee class, the key is ssn – Thus each employee is expected to have a unique ssn • Keys can be composite, e.g., – (key dnumber, dname)
  • 13.
    Slide 21- 13 ObjectFactory • An object factory is used to generate individual objects via its operations • An example: interface ObjectFactory { Object new (); }; • new() returns new objects with an object_id • One can create their own factory interface by inheriting the above interface
  • 14.
    Slide 21- 14 Interfaceand Class Definition • ODMG supports two concepts for specifying object types: – Interface – Class • There are similarities and differences between interfaces and classes • Both have behaviors (operations) and state (attributes and relationships)
  • 15.
    Slide 21- 15 ODMGInterface • An interface is a specification of the abstract behavior of an object type – State properties of an interface (i.e., its attributes and relationships) cannot be inherited from – Objects cannot be instantiated from an interface
  • 16.
    Slide 21- 16 ODMGClass • A class is a specification of abstract behavior and state of an object type – A class is Instantiable – Supports “extends” inheritance to allow both state and behavior inheritance among classes – Multiple inheritance via “extends” is not allowed
  • 17.
    Assignment • What doyou understand by collection object. Give example of some interfaces related to collection objects. • Explain the concept of interface and class on OODBMS