[Haskell-cafe] Re: Building "production stable" software in Haskell

apfelmus apfelmus at quantentunnel.de
Tue Sep 18 04:27:58 EDT 2007

Ketil Malde wrote:
> Neil Mitchell wrote:
>> DBM's can differentiate themselves on external database support,
> Surely this is an opportunity to focus development on a single library
> with broader support?  Currently, we have HSQL and HDBC supplying
> incompatible low-level interfaces, supporting a different set of back
> ends.  No matter what I choose, I risk having to make a costly
> conversion later on.

Yes, a common low-level interface is highly recommended. This does not 
only hold for DBMs, but also for XML, GUIs, vector graphics etc. The 
(imaginary, I'm a DB illiterate) picture is this:

  HDB ---------+                             +--- Borland
               |                             |
  LambdaBase --+--- Generic Low-level DB --- +--- Oracle
               |                             |
  hasqel ------+                             +--- MySQL
               |                             |
              ...                           ...

A common low-level interface factors the m <-> n relation into a m <-> 1 
and a 1 <-> n relation.

The story doesn't end here, since there can be additional low-level 
functionality that only some DB backends can offer but that some 
high-level interfaces require. But that's "just" a matter of putting 
another type class on top of the minimal low-level type class.

Of course, designing a low-level interface that is neither too powerful 
(not all back ends offer the functionality) nor too general (being 
almost trivial) and still simple enough is *hard*, especially since you 
can think about it for weeks without touching a computer.


More information about the Haskell-Cafe mailing list