Lecture2 OO Concepts
Lecture2 OO Concepts
Lecture 2
Object-Oriented Databases
Main Concepts
Lecture Resources
• Ramez Elmasri and Shamkant B. Nafathe,
Fundamentals of Database Systems, 5th Ed, Book
Slides.
▪ 13 mandatory features
▪ 5 optional characteristics
▪ 4 open choices
Object
behavior
▪ Inheritance
▪ Objects of subclass belong automatically to superclass
▪ Attributes, methods, and relationships are inherited from superclass
▪ Subclass can introduce new attributes, methods, and relationships
▪ Late binding
▪ Appropriate version of overloaded method selected at run time
▪ Also known as virtual method dispatching
Michael Grossniklaus , Object-Oriented Databases, Lecture slides published online on ODBMS.ORG
6. Overriding, Overloading and
Late Binding
▪ Method overriding
class student
{ attribute st_no int;
Attribute st_name string;
Void calc_grade (string year);};
class senior_student
(Extend student)
{Void calc_grade (string year);};
▪ Method overloading
class senior_student
(Extend student)
{Void calc_grade (int year);};
▪ Extensibility
▪ Database has a set of predefined types
▪ Developers can define new types according to requirements
▪ no usage distinction between system and user types
▪ Index management
▪ Data clustering
▪ Data buffering
▪ Query optimisation
12. Reliability
▪ Resiliency to user, software and hardware failures
▪ Logging of operations
▪ Application independent
▪ work on any possible database
▪ no need for additional methods on user-defined types
▪ multiple inheritance
▪ distribution
Inheritance in RDB
▪ RDB has no built-in support for inheritance
relationships; there are several options for mapping
inheritance relationships in an RDB
Inheritance in ODB
▪ Inheritance structures are built in ODB (and
achieved via “:” and extends operators)
Specification of Operations : RDB vs. ODB
RDB
▪ Operations specification may be delayed until
implementation
ODB
▪ Operations specified during design (as part of
class specification)