Object Oriented programming (OOP) has been touted as the silver
bullet to solve today’s programming challenges. At the same time many systems
will involve the manipulation of data stored in a Relational Database
Management System (RDBMS). The dichotomy presented by interfacing the Object and
Data models is often referred to as an ‘impedance mismatch’.
OO programmers are used to thinking in terms of the relations
between classes that encapsulate both data and methods, database gurus think
about the relations between data encapsulated in tables. COBRA is an object persistence layer written in the Java
programming language. It is uses relational database technology to provided
the persistent storage mechanism; however the store is fully encapsulate
shielding programmers from the details of relational database access.
-
The COBRA persistence layer fulfils the following requirements:
-
Fully encapsulates the underlying persistence mechanism. Only
the methods save, retrieve and delete need to be performed on an
object in order to create, retrieve, update or delete its attributes. There is
no need for programmers to hard code SQL into their objects.
-
A data dictionary to map objects and their attributes onto
their respective database, table and columns. Changing the database does not
imply recompiling the application.
-
Supports concurrent access by the same or different users to
the persistence mechanism.
-
Supports the grouping of actions on objects into discreet
transactions
-
Supports Object (or Persistence) Identifiers as a primary
mechanism for identifying objects.
-
Support legacy database schemas.
-
Support database cursors. Prior to version 2.0 Java Database
Connectivity (JDBC) does not directly support cursors, this omission can
result in large amounts of data being transferred over the network where
potentially only the first few rows of the query are of interest.
-
Support for object inheritance and composition.
-
Provide raw access to the persistence mechanism.
-
Supports multiple architectures, e.g. 2 – n tier.
-
Native support for distributed object architectures
including Common Object Request Broker (CORBA) and Remote Method Invocation (RMI)
Concise Object Relational Architecture
-
Support Multiple databases simultaneously.
-
Support for Java Database Connectivity (JDBC)
-
Provided access to RDBMS table meta data.
-
Permit retrieval/update/deletion of single or sets of
objects based on sophisticated selection criteria
-
Support pre-compiled SQL for efficiency
Not all of these objectives will be fulfilled in earlier
releases.