Re: Decline of Science: Computer Science and Databases

From: Carl Rosenberger <carl_at_db4o.com>
Date: Mon, 4 Nov 2002 00:11:26 +0100
Message-ID: <aq49vn$7t9$01$1_at_news.t-online.com>


Lauri Pietarinen wrote:
> It is unfortunate that the documentation of the actual
> D4-language is a bit hard to find. A more usefull link
> would be the following:
>
> http://docs.alphora.com/D4LGTableExpressions.html

Hi Lauri,

thanks for the link.

I would be even more interested to see some complex querying and view examples but I haven't found any on a quick glance.

Could you get me started?

We have just finished design and implementation of our S.O.D.A. querying API...
http://sourceforge.net/projects/sodaquery ...and I would love to compare it to the approach that Dataphor is using for complex queries.

I would be especially interested to see, how you handle table inheritance in your querying approach.

We don't invent new technologies just to use SQL, right?

Below I send along some of the nice possibilites that we provide with S.O.D.A. with a very lean API of 5 interfaces with 20 methods.

Kind regards,
Carl

public ObjectSet undefinedExtent() {

    Query q = db.query();
    q.descend("name").constrain("db").like();     return q.execute();

}

public ObjectSet callBackByInterface() {

    Query q = db.query();
    q.constrain(Fast.class);
    q.constrain(new Evaluation() {

        public void evaluate(Candidate candidate) {
            candidate.include(
              ((Fast) candidate.getObject()).getSpeed() > 1000
            );
        }

    });
    return q.execute();
}

interface Fast {

    int getSpeed();
}

public ObjectSet callBackRegularExpression() {

    Query q = db.query();
    Query qName = q.descend("name");
    final Pattern pattern = Pattern.compile("*4o*");     qName.constrain(new Evaluation() {

        public void evaluate(Candidate candidate) {
            candidate.include(pattern.matcher(
              ((String) candidate.getObject())).matches()
            );
        }

    });
    return q.execute();
}

public ObjectSet dualClass() {

    Query q = db.query();
    q.constrain(Consultant.class).or(q.constrain(Coach.class));     q.descend("salary").constrain(new Double(200000)).greater();     return q.execute();

}

public ObjectSet executeAnyNode() {

    Query q = db.query();
    q.constrain(Person.class);
    Query qContact = q.descend("contact");
    return qContact.execute();
} Received on Mon Nov 04 2002 - 00:11:26 CET

Original text of this message