Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Object Based Database

Avatar for Bhagyashri Pattankude Bhagyashri Pattankude
September 03, 2026
0

Object Based Database

Avatar for Bhagyashri Pattankude

Bhagyashri Pattankude

September 03, 2026

Transcript

  1. Presented BY : Ms. B.A.Pattankude Class : TY(CSE) Subject :

    Advance Database Engineering College: Sharad Institute of Technology collage of Engineering, Yadrav
  2. Object based Database  An Object based database is type

    of data base that store data in the form of objects similar to how objects are defined and used in object oriented programming  Object based database can store complex data types as objects, which include both the data and the methods that work on the data.  These database are designed to work well with applications that use object oriented programming.  An object typically has two components states means value and behavior means operation  In a traditional database, data is stored in tables made of rows and columns.  In object based database allow data to be stored as object.
  3.  Object oriented database store persistent objects permently in secondary

    storage and allow the sharing of these object among multiple program and application  Each object in object based database consist of attributes, methods, identity.  Object based database allow for the storage of complex data structure that can not be easily stored using conventional database
  4. Object Identity  Object Identity (OID) is a fundamental concept

    in object-based databases that uniquely identifies each object stored in the database.  It means every object has a special, permanent identifier that distinguishes it from every other object, no matter what data it contains. Why is Object Identity Important in Object-Based Databases?  In traditional relational databases, data is identified by values in columns (like a primary key).  But in object-based databases, objects can have complex structures and might not have simple keys.  Object Identity ensures that even if two objects look the same (same attributes and values), they are treated as different entities if they have different identities.  This allows the database to track and manage objects properly, especially when objects are shared or referenced by other objects.
  5. Object Identity  One goal of an object-based database is

    to make sure that real-world things and database objects match directly, so the objects keep their true identity and can be easily found and used.  Unique identity is assigned to each independent object stored in the database  This unique identity is typically implemented via a unique system generated object identifier (OID)  In object-based databases, the Object Identifier (OID) is usually hidden from external users because it’s mainly used internally by the system to keep track of objects.  The main property required of an OID is that it be Immutable , that is OID value of a particular object should not change.  OID be used only once , that is even if an objected removed from the database, its OID should not be assigned to another object.
  6.  OID should not depend on any attribute values of

    the object: OID (Object Identifier) must uniquely identify an object regardless of what data it holds. If OID was based on attribute values, then:  Changing those attribute values would change the OID.  That would make it hard to keep track of the same object over time.  By keeping OID independent of attributes, the object can change its data without losing its identity.  This helps the database maintain consistency and avoid confusion between objects.  OID must be separate from the data so that the object’s identity stays the same even if its attributes change.
  7. Object Structure  Object based database manage data as objects

    similar to objects in object in object oriented programming  The object structure is the core concept of that define how data & behavior are packaged & stored  An object is self –contained entity consisting of identity , state, behavior Components of Object Structure 1. Object Identity(OID)  Every object has a unique object identifier (OID).  The OID is assigned internally by the database and remains unchanged.  This identifier differentiates objects even if they have identical attribute values.  OIDs allow the database to manage object references and relationships.
  8. 2. Attributes(state)  Attributes represent the state or properties of

    the object.  They hold the actual data values related to the object.  Attributes can be simple data types (e.g., integer, string) or complex data types (e.g., arrays, lists, sets, other objects). For an object of class Person Attribute Type Description Name Age String Int Person name Person age
  9. 3. Methods Functions or procedures associated with the object that

    define how the object behaves or responds to messages. Methods operate on the object internal data and can enforce business rules, perform calculations or manipulate other object 4. Class &Inheritance type. Object belong to a class ,which defines a template or blueprint of that Class can inherit attribute and method from superclass, enabling and polymorphism 5. Encapsulation Internal details of an object are hidden from the outside world. Access is provided only through defined interfaces (methods). Promotes data security and integrity.
  10. Example of Object Structure Object (OID: 1001) class: Person Attributes:

    name: "Riya Patil" age: 35 address: (Reference to address object with OID) Methods: getname() getage() setaddress(newaddress)
  11. Type Constructors  A type constructor is a mechanism used

    in an Object-Based Database / Object-Oriented Database to create complex data types by combining simpler or existing types.  In a traditional relational database, data is generally stored in simple atomic values such as integers, strings, and dates.  In an object-based database, a type can contain collections, structures, objects, and relationships, making it possible to represent real-world entities more naturally.  In simple words, a type constructor helps us combine different pieces of data and store them together in a meaningful way. Why Type Constructors are Needed Suppose we want to represent a student: Student ID → integer Name → string Phone numbers → integer Address → multiple attributes Courses → collection of courses
  12.  A simple data type cannot represent all this information

    conveniently.  A type constructor allows us to build a complex type from these smaller types.
  13. Types of Constructors 1. Atomic Types 2. Tuple Constructor 3.

    Collection or Multivalued Constructor a) Set Constructor b) Bag Constructor c) List Constructor d) Array Constructor e) Dictionary Constructor
  14. 1. Atomic Types These are primitive data type . Or

    this include the basic built in data type of the object model which are similar to basic types in many programming languages integer, string, floating point, Boolean. this basic data type are called single valued or atomic types. Example Student_ID : Integer 2.Tuple Constructor A tuple is a fixed set of named attributes, each with it’s own type. It is similar to records or struct programming. It also referred as struct constructor. A structured type is made up of several components and is also sometimes referred as a compound or composite type Example Struct name <FristName: String, Middle :String , LastName: String>
  15. 3. Collection or Multivalued Constructor This type constructor include set,

    list, bag, array and dictionary type constructor. These constructor are also considered to be type generators because many different types can created A collection constructor (also called a multivalued constructor) is used to define attributes that hold multiple values — instead of a single value — inside an object or tuple. This is useful when you want to store a group of items (like a list of phone numbers, or a set of enrolled courses) as part of one object. A. Set Constructor A set constructor is an unordered collection of unique elements. means no duplicates allowed. B. Bag Constructor Bag constructor also called as multiset constructor . It is same as or similar to be set constructor but it allows duplicates and is unordered.
  16. C. List Constructor A list is an ordered collection and

    duplicates are allowed. The list Constructor will create an ordered list [i1, i2, i3, ... in] of OID or values of the same type. The list constructor similar to bag constructor except that element in a list are ordered and hence we can refer to the first, second or nth element. D. Array Constructor An array is fixed size , ordered collection. The array constructor create a single dimensional array of element of same type. it is less flexible than lists but useful when size is constant. E. Dictionary Constructor Dictionary constructor creates collection of key-vale pairs(K,V) where the value of a key k can be used to retrieve the corresponding value v. A Dictionary constructor (sometimes called a map or associative array) is a type constructor used to define an attribute that stores a collection of keyvalue pairs.
  17. Encapsulation of Operation  The concept of encapsulation is one

    of the main characteristics of OO language & system.  It means combining the data (attributes) and the operations (methods) that manipulate that data into a single unit called an object.  This bundling hides the internal details of the data from the outside world.  Traditional database systems don’t use encapsulation because they usually show the data structure openly to users and external programs. For example, in traditional databases like the relational model, operations like selecting, inserting, deleting, and updating data are general and can be used on any table. The tables and their columns are visible to users and programs, which access the data using these operations.  Encapsulation is applied to database object in ODB by defining the behavior of a type of object based.  The interface part of an operation is sometimes called t signature & the operation implementation is sometimes called method.
  18. Encapsulation Method  In object-based databases, method encapsulation refers to

    binding the methods (operations) directly with the data they manipulate inside the object. This means:  The object hides its internal data.  External programs cannot directly access or change the object's data.  Instead, they must use the object's methods to interact with it.  These methods act as controlled access points to perform action such as - creating or destroying objects - retrieving or updating value - performing business logic.  In object databases, encapsulation is supported using an object schema definition language like ODMG ODL.
  19.  Imagine a BankAccount object: Data: balance Methods: deposit(), withdraw()

    Instead of letting the user directly change the balance, they must use deposit() or withdraw(). These methods: Check for valid amounts Prevent negative balances Log transactions So, the data is safe and all actions are controlled.
  20. Persistence  Persistent data is saved in a way that

    it remain available even after the application that created it stops running.  when an object is persistent, its data is saved to a database or file, so it doesn’t get lost when the program ends or the system restarts  A transient object exists only while the program is running. Once the program stops, the object is lost.  A persistent object, on the other hand, is saved in a database, so it remains even after the program ends.  To make an object persistent, two common methods are used: 1. Naming – giving the object a name so it can be stored and retrieved later. 2. Reachability – if an object is connected to another persistent object, it also becomes persistent automatically.  this persistent object name can be given via specific statement or operation
  21. Type and Class Hierarchies  Another important of object database

    is that they support type hierarchies and inheritances.  In object-based databases, data is represented using objects, which are grouped into classes or types. These classes/types can be organized into hierarchies, just like in object-oriented programming.  A type is creator or define by assigning it a type name and then defining number of attribute  A type hierarchy is similar, but it focuses on data types and their structure, not necessarily behavior.  Types describe the structure (like attributes) of data.  A subtype can extend a supertype by adding more attributes.
  22. Example: Person (name, age) ← supertype | Student (name, age,

    rollNo) ← subtype Student is a subtype of Person because it has all of Person’s attributes, plus rollNo.
  23.  A class hierarchy defines how classes are related through

    inheritance.  One class (called a subclass) can inherit properties and methods from another class (called a superclass).  This creates a parent-child relationship between classes.  The subclass can also add new attributes or methods or override inherited ones. Example: Vehicle / Car ← superclass \ Bike ← subclasses Vehicle has common attributes like speed, fuel. Car and Bike inherit these, and may have their own, like numDoors or handleType.
  24. Inheritance  Inheritance is an object based database is the

    ability for one class to inherit attributes& method from another class.  OODB system merge database capabilities with object-oriented feature meaning data as objects and the supports encapsulation, inheritance and polymorphism  Superclass (Base class) the class that provides attributes & methods to other class.  Subclass(Derived class) the class that inherits from the superclass & can use all attributes , methods of superclass add new attributes method.  SQL standard does not support multiple inheritance means multiple inheritance class inherits from more than one parent class .
  25. Example CREATE TYPE Person As Object( name VARCHAR2(20), address VARCHAR2(20)

    ); CREATE TYPE Student UNDER Person ( degree VARCHAR2(20), department VARCHAR2(20) ); CREATE TYPE Teacher UNDER Person ( salary INTEGER, department VARCHAR2(20) );
  26. Table Inheritance  Table inheritance is a concept used in

    object-based (or object-relational) databases where tables can inherit structure (columns) from other tables, similar to class inheritance in object-oriented programming.  It allows you to create specialized tables that inherit attributes and behaviors from general tables, promoting reusability, extensibility, and logical data modeling.  SQL supports this by allowing one table to inherit from another.
  27. Example CREATE TABLE person ( person_id INT PRIMARY KEY AUTO_INCREMENT,

    name VARCHAR(50), birth_date DATE ); CREATE TABLE employee1 ( employee_id INT PRIMARY KEY AUTO_INCREMENT, person_id INT, employee_number INT, hire_date DATE, FOREIGN KEY (person_id) REFERENCES person(person_id) );
  28. Complex Object  In SQL, we can now create complex

    objects instead of just storing simple rows and columns. This is done using User-Defined Types (UDTs).  UDT (User Defined Type):It allows you to create your own data structure (like a custom datatype).Example: Instead of just using INT, VARCHAR, etc., you can make something like an Address type with street, city, and pincode inside it.  Because sometimes our data is not simple. For example, a student may have multiple phone numbers, or an employee may have multiple skills. Normal SQL tables are not enough for such data.  SQL also allows collections (like lists or sets) so that you can store multiple values inside a single attribute. Example: a list of phone numbers.  Syntax A simple UDT is created like this: CREATE TYPE type_name AS (<component_declaration>);
  29. Example CREATE TYPE Address AS ( street VARCHAR(50), city VARCHAR(30),

    pincode INT ); CREATE TYPE Student AS ( name VARCHAR(50), roll_no INT, home_address Address );
  30. Language & Design :ODMG Model  ODMG stands for Object

    Data Management Group  ODMG Model is standard framework for object database, defining how objects & classes are represented, how schemas are defined using ODL, how query data using OQL and how to manipulate data using OML.  The ODMG object model is the data model upon which is the Object Definition Language(ODL) & Object Query Language(OQL)are based.  Object and literals are basic building block of the object model. Object having state and object identifier.  The object has five aspects: identifier, name , lifetime, structure and creation  The OID is Unique Identifier . Every object have an OID.  the lifetime of object specifies whether it is a persistent object or transient object.  The structure of object specifies how the object is constructed by using type constructor.
  31.  There are three types of literals atomic, structured, and

    collection.  Atomic literals corresponds to the value of basic data type and predefined.  Structured literals corresponds using the tuple constructor.  Collection literal value that is collection of object or values but collection does not have object id.  In ODMG Object model two types of inheritance. Behavior inheritance and type inheritance  Behavior inheritance requires the super type of an interface where as subtype could be either class or interface.  Type inheritance is specified by the keyword extends.  It is used to inherit both state and behavior strictly among classes so both supertype an subtype must be classes
  32. Object Definition Language  The Object Definition Language (ODL) is

    a declarative language used to define the structure (schema) of objects stored in an object-oriented (or object-based) database.  It was introduced as part of the ODMG (Object Data Management Group) standard and is used to specify: Classes (Interfaces) Attributes (fields) Relationships Inheritance Keys (object identity)  ODL (Object Definition Language) is not a programming language — it's a schema definition language, not meant for general-purpose programming.  ODL is Like DDL(Data Definition Language) in SQL
  33.  The core building blocks in ODL are interface similar

    to class programming.  An interface define the attribute & method that object of that type will have  In ODL having attribute describe data fields of object . They have name & a type attributers can be single-valued or multi valued .  In the ODL methods define operation or behaviors for the object they specify what an objects can do or what action can be performed it.  ODL supports inheritance , a new interface can based on a existing one & inherit its attribute and methods.  In ODL relationships can be one-to-one, one-to-many, many-to-many.
  34. Example // Defining an Author class interface Author { attribute

    string name; attribute string nationality; relationship set<Book> booksWritten inverse Book::author; }; // Defining a Book class interface Book { attribute string title; attribute string ISBN; attribute integer publicationYear; relationship Author author inverse Author::booksWritten; };
  35. Object Query Language  OQL stands for object Query Language

     OQL (Object Query Language) is a query language designed specifically for object-oriented databases (OODB). It’s similar to SQL (Structured Query Language), but it works with objects, attributes, methods, and relationships, not just tables and rows.  OQL is defined by the Object Data Management Group (ODMG) standard.  Supports inheritance, encapsulation, and polymorphism  allows complex queries using object relationships  The syntax of OQL is similar to SQL but with extensions to handle objects & their complex structure. It includes following components Select Where From Order by In
  36. Example 1. Get Names of All Students SELECT s.name FROM

    Student s 2.Get Titles of Courses Enrolled by a Student Named “Raj” SELECT c.title FROM Student s, s.enrolledCourses c WHERE s.name = “Raj“ 3.Get All Students Enrolled in a Course Titled "Database Systems“ SELECT s.name FROM Course c, c.enrolledStudents s WHERE c.title = "Database Systems“ 4.
  37. 4. Count How Many Students Are in Each Course SELECT

    c.title, COUNT(c.enrolledStudents) FROM Course c SELECT s.name FROM Student s WHERE s.age > 18 AND EXISTS ( SELECT c FROM s.courses c WHERE c.name = "Database Systems" );This retrieves names of students over 18 who are enrolled in "Database Systems".