Object-Oriented Databases v OO systems associated with – graphical user interface (GUI) – powerful modeling techniques – advanced data management capabilities v What effect will OO concepts have on DB design? v What about the Extended Relational System?
OBJECT-ORIENTATION A set of design and development principles based on the idea of conceptually autonomous structures Each autonomous structure represents a real-world entity with the ability to interact with itself and with other objects
Object Orientation v Conceptually autonomous structures v Modularity v Inconsistent OO concept definitions v Originates in OO programming v Tradition: separate procedures from data v OO: objects perform operations on themselves
OO view of the world endows data with manipulative ability v Data no longer passive v Data + procedures = OBJECT v Object can act on itself v Object contains data and code v Concept natural to those with little programming experience but confusing to many with traditional programming expertise
OO Concepts v Object is essentially a new name for entity v Difference: its ability to interact with other objects and itself v Object has a unique identifier (OID) and attributes called instance variables v Object attributes may reference other objects allowing the implementation of relationships v Messages and methods
Depiction of an Object Object X Data Method 1Method 2 Method 3 Method 4 Method 5
OO Concepts v Every operation to be performed on an object must be implemented by a method v Every method is identified by its name and has a body v Body is composed of computer instructions in some programming language v To invoke a method a message is sent to an object containing that method v Message contains object identification, method name and any required parameters v Encapsulation: hiding internal details on attributes and methods v Objects with common characteristics are grouped into classes
Instance variables Methods Class defines Messages Protocol Private AspectPublic Aspect collection of are the names of the BehaviorState OID (unique) Object has implemented by a set of belongs to a defines a set of values for its that trigger OO Summary
Superclasses, Subclasses, Inheritance v Classes are organized in a class hierarchy or class lattice v Object inherits attributes and methods of its class and all classes above it v Inheritance enables reusability v Single and multiple inheritance v Method overriding and polymorphism v Abstract data types, implemented as classes, provide support for complex objects
The Evolution of Data Models Hierarchical CODASYL (network) Relational Entity-Relationship Semantic Extended RelationalObject-Oriented Physical data dependency Difficult to represent M:N relationships No ad hoc queries Access path predefined (navigational access) Provide ad hoc queries Set-oriented access Weak semantic contents Easy to understand Incorporates more semantics More semantics in data model Support for complex objects Inheritance
Characteristics of OODM v Supports complex objects v Enables the definition of abstract data types v Supports encapsulation v Exhibits inheritance v Supports the notion of object identity (OID)
Comparing OODM and ERDM E-R Model OO Data Model Object Class Instance Variable N/A OID Method Class hierarchy Entity Entity set Attribute Primary key N/A E-R diagram
Object Diagrams SO Model from page 177
Class-Subclass Relationships