Sarah wrote:
> I m doing a research survey on Querying Object-Oriented Databases. I
> have come across 3 types of approaches.
>
> 1. Object-Oriented database queried by Object-Oriented Language
> 2. Object-Oriented database queried by Relational Language
> 3. Relational database queried by Object-Oriented Language
>
> For the survey i have to evaluate the different products of these
> three kinds of approaches.Can anyone help me in identifying the
> products for these approaches
Hi Sarah,
I am quite sure that your posting will start discussions about
terminologies. Is SQL relational? How does an object-oriented
query language look like?
Let me list some of the query approaches available:
S.O.D.A.
--------
I start with this one and I will write a little more detailed, since
this is our approach.
To use S.O.D.A. you construct a graph representation to represent the
objects that you are looking for, very much like query-by-example.
Every node of this graph is a constraint to the query - by class or
value. Navigation through the graph is possible from root to leaves by
using field names. You can add any complex object to every node as a
constraint. Every non-null field value will be added to the graph. The
evaluation mode of nodes can be modified individually. You can run the
values of a node of the graph against your own code during query
evaluation.
Here are two examples to document the above.
Simplest possible: Query-by-Example
-----------------------------------
// Assuming that you have a Person object created somewhere in code
// with some of the field values set by a form or whatever:
Person person;
person.setFirstName("Peter");
person.setLastName("Pan");
// Simply plug the object into a S.O.D.A. query:
Query q = database.query();
q.constrain(person);
ObjectSet objectSet = q.execute();
More features
-------------
// Let's start off with the person class
Query q = database.query();
q.constrain(Person.class);
// Navigating to a node and modifying the evaluation mode
q.descend("age").constrain(new Integer(30)).greater();
// setting up your own code to run in the the query
q.constrain(new Evaluation() {
public void evaluate(Candidate candidate) {
Person person = candidate.getObject();
boolean take = person.calculateSalary() > 40000;
candidate.include(take);
}
});
// and execute the above
ObjectSet objectSet = q.execute();
Clearly S.O.D.A. is object-oriented, as object-oriented can be.
JDOQL
-----
JDO is an attempt to set a standard for Java object persistence.
JDO comes with a querying approach named "JDOQL". JDOQL allows you to
write Java-like code as "filters" in string expressions. You can plug
in object values as parameters.
JDO was written for object databases *and* object-relational mappers
and it shows. The O-R mapper implementations create single SQL queries
from JDOQL queries so clearly the ability to create this mapping was a
constraint in the specification process. The fact that SQL support is
planned to be a feature for next-generation JDO shows that JDOQL is
not a success.
I wouldn't really call JDOQL "object-oriented", but it's an attempt.
SQL
---
This is the mainstream relational querying language and I need not say
more.
SQL is not object-oriented.
There are some dialects that support table inheritance which I think is
a good approach.
Some products support serializing objects to attributes and calling
attribute methods during queries. In my opinion the approach breaks
both the relational concept and the object-oriented concept. What if
the object in the table attribute needs to hold a reference to another
table or another attribute? It doesn't work.
OQL
---
OQL is an object extension to SQL, that was developed and maintainted by
the ODMG. The ODMG is no longer in existence. Most of the people that used
to be involved with the ODMG became part of the JDO specification process.
Sind the ODMG is dead, OQL is somewhat dead also.
Propietary object APIs (let's call them "POA")
-----------------------------------------------
Many object databases supply their own query mechanims. Most of them only
allow simple tasks, not really advanced. It's up to you, what you will let
the through as "queried by object-oriented languages".
Here are some suggestions for products that you could try as representatives
for the above:
( no guarantees on my list of querying support, please correct me if
I am wrong)
Object databases
----------------
db4o S.O.D.A.
FastObjects OQL, JDOQL
Versant VDS SQL, JDOQL, POA
Intersystems Caché SQL
Object Relational mappers
-------------------------
Hibernate POA
Apache OJB OQL, JDOQL
Solarmetric Kodo JDOQL
If you need a list of all object database products, you may want to use the
links on the following websites:
<a style='text-decoration: underline;' href="http://www.cetus-links.org/oo_db_systems_1.html" target="_blank">http://www.cetus-links.org/oo_db_systems_1.html</a>
<a style='text-decoration: underline;' href="http://www.odbms.org" target="_blank">http://www.odbms.org</a>
Kind regards,
Carl
--
Carl Rosenberger
db4o - database for objects - <a style='text-decoration: underline;' href="http://www.db4o.com" target="_blank">http://www.db4o.com</a><!-- ~MESSAGE_AFTER~ -->
>> Stay informed about: Object-Oriented databases Reaerch