Re: Mixing OO and DB

From: S Perryman <>
Date: Wed, 12 Mar 2008 16:14:44 +0000
Message-ID: <fr8vhv$tcd$>

Bob Badour wrote:

>> Robert Martin wrote:

>>> That's fine. Consider, for example, an algorithm that finds the
>>> minimum spanning distance of a graph. (e.g. cheapest network route, or
>>> cheapest travel itinerary, etc). The node and edges of the graph are
>>> stored in database tables.

>>> Shall we execute that algorithm by doing thousands of tiny queries as
>>> we walk from node to node through the edges? Or shall we query all the
>>> nodes and edges in one gulp, arrange them into a graph of objects, and
>>> walk through them that way?

> If one studies the algorithms for minimum spanning trees, one quickly 
> sees the task involves no traversals whatsoever. In fact, one generally 
> creates the MST as a precursor to some sort of traversal, and the 
> algorithms themselves are specified in terms of sets, which makes them 
> ideal for implementing relationally.

What about the canonical graph algorithms (breadth/depth first, transitive closure etc) ??

Traversal (accessing adjacent node sets) for these happens on a per-node basis, does it not.

Steven Perryman Received on Wed Mar 12 2008 - 17:14:44 CET

Original text of this message