comp.lang.ada
 help / color / mirror / Atom feed
From: Maciej Sobczak <see.my.homepage@gmail.com>
Subject: Re: SOCI-Ada: The Database Access Library for Ada
Date: Thu, 7 Aug 2008 08:43:03 -0700 (PDT)
Date: 2008-08-07T08:43:03-07:00	[thread overview]
Message-ID: <21f1f8b4-8e25-4b3f-90fa-004595237c1a@e39g2000hsf.googlegroups.com> (raw)
In-Reply-To: 6g0hikFdkv5oU1@mid.individual.net

On 7 Sie, 17:10, "Alex R. Mosteo" <devn...@mailinator.com> wrote:

> As for comments for improvement, after a quick read I would like to see one
> example on how to use pooled connections.

You can find it in the test program that is included as part of the
package (the archive, not the Ada one :-) ).
I have decided not to include the connection pool example in the
"idioms" part, because connection pools are usually needed in bigger
contexts and the simple example would be artificial - whereas other
examples still make sense, even in such short forms.

I will think about some reasonable example for connection pools.
Again, one is in the test program - it is the last test.

> Another thing is that in C++ there's mimicking of embedded SQL using the "<<"
> operator. Can't this be to some extent emulated in Ada with some operator
> overloading?

I think that the design of the library, including its syntax, needs to
reflect the general spirit of the community that is going to use it.

For example, I find it quite easy to sell this:

int count;
sql << "select count(*) from persons", into(count);

to C++ programmers - for one thing, it looks like streams and indeed
streams can be involved to format parts of the query and in general
the whole statement looks "cool".
An important factor here is that there are lots of C++ libraries that
use operator overloading extensively (including the standard library!)
and that's why C++ programmers can accept this technique even on the
border of abuse.
Please see this page:

http://soci.sourceforge.net/doc/rationale.html

for the rationale of different syntax elements in C++.

Contrary to the above, I think that Ada programmers would find such
syntax "a bit" overboard.
I have decided not to stress the audience with any operator
overloading and provide the "classical" interface that is in line with
the interfaces of other Ada libraries - in particular the standard
library.

--
Maciej Sobczak * www.msobczak.com * www.inspirel.com



  reply	other threads:[~2008-08-07 15:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-07  9:18 SOCI-Ada: The Database Access Library for Ada Maciej Sobczak
2008-08-07 15:10 ` Alex R. Mosteo
2008-08-07 15:43   ` Maciej Sobczak [this message]
2008-08-08 13:47     ` Alex R. Mosteo
2008-08-08 15:31       ` Maciej Sobczak
2008-08-19  9:01         ` Alex R. Mosteo
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox