Background• Object-oriented software, based on theprinciples of user-defined datatypes, alongwith inheritance and polymorphism, isfirmly established in the software industry(consider C++, Java, Visual Basic, C#,etc.)• However, the popularity of OO softwarehas no relation with the popularity, or not,of OODBMS.
Background• The debate between relational versus oowithin the DB community parallels thedebate between vector and raster in theGIS community during the 70’s and 80’s.• Market adoption of OODBMS has beenlimited. This has implications:– Reduced financial and engineering resourcesto performance-tune products.– SQL has retained its dominance as the linguafranca of the database world.
Background• Relational databases that incorporateADTs and other principles of oo designare called object relational DBS (OR-DBMS).• These databases have taken the steamout of the OO engine, and appear to havethe upper hand in ‘modern’ DMBS.
Background• Recall that RDBMS represents themes throughrelations (tables).– A geographic object is one tuple (row) of such arelation.– Each column is an attribute.• Attributes have alphanumeric types (e.g.,character, string, time, date, real, logical).BLOBS are a recent addition.• Relationships are not explicit, but implied byvalues in specific fields (e.g., foreign keys).
RDBMS?• To incorporate spatial concepts into aRDBMS requires considerable re-organization of the RDBMS databasestructure, which violates the dataindependence principle (you need to knowfar more about a theme in order todetermine what type of spatial entity it is,and what type of operations arepermissible).
RDBMS• Performance suffers greatly as a result ofthe significant modifications required toincorporate space.• Topology is not implicit.• As a result, most systems were based ona loose coupling approach (e.g., Arc /Info).
OO DBMS• OO systems were first developed in the1980s, when oo programming languagessuch as Simula and Smalltalk firstemerged.• The initial reaction was that, within a fewyears, all databases would be oodatabases. Such predictions wereobviously way off the mark.
OO Advantages• OO principles brought to databases:– New modeling power– Extensibility of systems– Code reuse– Easy maintenance of programs• However, it is only recently that OOprogramming has itself really taken off.
OODBMS Terminology• Object Identity: An object is denoted in aunique way in the database system, usingan identifier or OID (object identifier) thatthe objects keeps during its entire lifetime,independently of its attribute values.
OODBMS Terminology• Type: the type of an object corresponds to itsstructure and to the operations that can beperformed on it.– Atomic types, such as strings and integer– Complex types are defined using ‘constructors’(tuples or set constructors).• An object (o) can have as an atomic value notonly a string or real but also the OID of anotherobject o’. Object o is said to consist of object o’
OODBMS Terminology• Objects with the same type are groupedinto classes.• Classes encompass objects having thesame structure and behaviour, which isexpressed by the set of methods oroperations applicable to the objects theycontain.
• Encapsulation: A class corresponds to theimplementation of an abstract data type(ADT).– Encapsulation means that neither thestructure of the ADT nor its implementation isvisible from the outside world.– Programmers will know how the ADT isimplemented, whereas end users only knowthe specification.
OODBMS Terminology• ADTs: Abstract data types – combinations ofdata types (e.g., polygon) and their operations(e.g., PolygonArea [an operation that wouldcompute the area of a polygon]). Note that theDBMS need not have any knowledge on theADT implementation (i.e., the codecorresponding to the operations).• ADTs are encapsulated in the sense that theyare accessible only through the operations thatare defined on them.
• ADTs have been ‘regularized’ in the sensethat the geographic dimension (e.g.,points, line segments [nodes only havetwo arcs], complex polylines [nodes canhave two or more connected arcs],polygons) is used to clearly distinguishbetween them.
OODBMS Terminology• Inheritance: Subclasses are defined from an existingsuperclass with a refinement of its structure.– Subclasses inherit methods and structures from the superclass(e.g., all methods defined for the superclass can be used in thesubclass).– However, a subclass can redefine a method defined in thesuperclass.– A subclass can also have methods defined only for thatsubclass. This leads to polymorphism.• The subclass is a specialization of the superclass, andthe superclass is a generalization of the subclass.• A subclass can inherit from many superclasses.
• Most OO DBMS use OQL rather than SQL astheir query language.• OQL is aware of the complex structures presentin the OODBMS, and can return complexresults.• SQL is used as the DDL, DQL and DML (datadefinition, data query, and data manipulationlanguage).• In OODBMS, the primary means of developingthe database is through the native OO language.
OR DBMS• PostgresSQL is the best known OR DBMS• It allows the user to extend the system byincorporating new data types—a user canintegrate geometric types and operations,as well as spatial indexing.• ORDBMS incorporate ADTs, but still usetables.• OR SQL contains extensions to standardSQL than enable access to ADTs.
• Software such as ESRI’s SDE is based onan ORDBMS approach.