[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] DBI

From: Graham Fawcett
Subject: Re: [Chicken-users] DBI
Date: Thu, 28 Feb 2008 10:49:45 -0500

On Thu, Feb 28, 2008 at 10:30 AM, Peter Bex <address@hidden> wrote:
> On Thu, Feb 28, 2008 at 10:05:58AM -0500, Graham Fawcett wrote:
>  > >  Why the thunk? (why not directly the port?)
>  >
>  > Laziness: it avoids the overhead of setting up the input port if it's
>  > not required. You might want to iterate over a set of (id, name, blob)
>  > records and only open the blob if the name meets some criteria that
>  > are local to the app (i.e. can't be expressed in a WHERE clause).
>  You can make a 'smart' custom port that only really opens the blob when
>  you first read from it (it has to be a custom port anyway, so this is
>  not too much extra work).  This makes for a more convenient API, IMHO.

That's true. I was going to argue that it doesn't have to be a custom
port (some interfaces may return a TCP port to consume the blob, for
example) and that I'd rather not add an extra layer. But using a
custom port would also ensure that the right cleanup code was called,
and that's a big win. The custom-port is a good solution.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]