Object based Databases
Object based database
• An object-oriented database (OODBMS) or object database management
system (ODBMS) is a database that is based on object-oriented
programming (OOP).
• This is basically a database where the data is represented and stored in
the form of objects instead of tables and rows.
• They directly store data and complex data & relationship without using
rows and tables of other databases
Object based database: Object – Relational
features
• Object oriented database systems are alternative to relational
database and other database systems.
• Object oriented databases are exactly same as object oriented
programming languages. If we can combine the features of
relational model (transaction, concurrency, recovery) to object
oriented databases, the resultant model is called as object
oriented database model.
Features of OODBMS
• Object
Object consists of entity and attributes which can describe the
state of real world object and action associated with that object
Eg: Employee , Student, Staff, College, university
• Attributes
Attributes are nothing but the properties of objects in the system.
Emp-id
Age
DOB
Features of OODBMS
• INHERITANCE
• Inheritance is considered important in object-oriented design because it enables re-
usability.
• It is defined as the method of creating new classes from existing classes. The new
classes not only inherit the properties of their parent class, but they also have their
own unique properties
• Creating a new object from an existing object in such a way that new object inherits
all characteristics of an existing object.
Features of OODBMS
• Encapsulation
It is an data hiding concept in OOPL which binds the data and
functions together which can manipulate data and not visible to
outside world
Features of OODBMS
Polymorphism
• Polymorphism is a OOPs concept where one name can have many forms.
• For example, you have a smartphone for communication. The communication
mode you choose could be anything. It can be a call, a text message, a picture
message, mail, etc. So, the goal is common that is communication, but their
approach is different. This is called Polymorphism
Features of OODBMS
• Association
• Association refers to links between the various entities of an application. In
an object-oriented database, association is denoted as references between
various objects.
• For example, individuals from a 'Person' class can also be associated with
the 'Committee' class. The association name here can be called
'Membership' as outlined in this figure below.
ODMG OBJECT MODEL
• ODMG stands for Object Data Management Group
• This group come up with specification for using object oriented
database
ODMG has three parts
[Link] Definition language(ODL)
2. Object Query Language(OQL)
3. Object Manuplation Language(OML)
ODMG OBJECT MODEL
• ODL: It is similar to DDL(Data Definition Language) in SQL
• OQL:it is similar to DML( Data manipulation Language)
Support SQL JOIN and SELECT
OML: Extension of OQL support INSERT, UPDATE or DELETE
operations
Object based database- Applications
common applications that use object databases are
• Architectural & engineering for 3D modeling,
• Multimedia and image database
• Maps
Advantages of Object based database
• Object based database provide persistance storage to objects (directly
store data not in tables)
• One other strong advantage of Object Based Databases is that you are
not forced to think very much about the data structure as it easily
allows for changes to the data structure without affecting the entire
system.
Object based database – Sample code
• {
• "firstName": "John",
• "lastName": "Smith",
• "isAlive": true,
• "age": 25,
• "address": {
• "streetAddress": "21 2nd
Street",
• "city": "New York",
• "state": "NY",
• "postalCode": "10021-3100"
• }
Disadvantages of object based database