comp.lang.ada
 help / color / mirror / Atom feed
* APQ
@ 2004-12-15 23:31 Brian May
  2004-12-16 11:34 ` APQ Warren W. Gay VE3WWG
  2004-12-17 13:54 ` APQ Dmitry A. Kazakov
  0 siblings, 2 replies; 32+ messages in thread
From: Brian May @ 2004-12-15 23:31 UTC (permalink / raw)


Hello,

Here are my suggested changes to APQ (not actually done or tested).

1. Decide on or write a "smart pointer" library. ie. a library that
manages pointers based on a reference count. Obviously the license
must be compatible with the license of APQ.

2. No change to Connection_Type or Root_Connection_Type.

3. Create new Database_Type. This type should not be
tagged. Applications will use this instead of the
Root_Connection_Type. It has the following data:

* Smart pointer to Root_Connection_Type'Class. This is dynamically
  allocated when the connection is created.

It has the following methods:

  * Connect method takes a string, which is the connection URL.  Note:
    Two ways of implementing:

    1. connect is hard-coded to support every possible database, and
       parses the URL itself.

    2. each database is registered in a global list, connect
       determines the most appropriate database based on prefix in URL
       and calls appropriate connect method with URL.

    The second method is more complicated but more flexible. In any
    case, changing this should not require changing the user API.

  * All methods associated with Root_Connection_Type. This does *not*
    include options to set options specific to the database, like user
    name or password. These call the appropriate routine in the
    Root_Connection_Type'Class. Status information should perhaps be
    cached, so it remains constant even after queries (might be more
    appropriate way to handle errors).

  * New_Query takes a *Database_Type* parameter, not a
    Root_Connection_Type parameter. This function constraints a query
    and saves a smart pointer to the Root_Connection_Type contained
    within the Database_Type variable.

  * Debatable: Function that returns smart pointer to
    Root_Connection_Type'Class.  This might be required to access
    database specific functions. Ideally it shouldn't be required.


4. Modify Root_Query_Type class:

   New_Query is the only function that takes a *Database_Type*
   parameter.

   The functions that use to require Root_Connection_Type now use the
   smart pointer that was saved instead.

   Why not make the procedures abstract instead of having them raise
   an Is_Abstract? This way the checks can be done at compile time.

   Execute already returns exception if not connected.

   Add methods for obtaining and clearing status information. This
   should be cached so if you execute two separate queries (in two
   separate variables) on the same database, you will get two status
   messages saved.


I hope this helps explain what I said earlier... I believe this solves
a number of concerns with the existing system in one go.

The major difference is that I have created a new Database_Type class,
which allows the Connection_Type to be shared in a safe manner between
the user Database_Type and the user Query_Type classes.

This would involve making incompatible changes to Root_Query_Type. It
might be possible to avoid this, not sure if it would be worth the
effort.

Comments?
-- 
Brian May <bam@snoopy.apana.org.au>



^ permalink raw reply	[flat|nested] 32+ messages in thread
* Re: APQ
@ 2004-12-16  4:37 Christoph Karl Walter Grein
  0 siblings, 0 replies; 32+ messages in thread
From: Christoph Karl Walter Grein @ 2004-12-16  4:37 UTC (permalink / raw)
  To: comp.lang.ada

> 1. Decide on or write a "smart pointer" library. ie. a library that
> manages pointers based on a reference count. Obviously the license
> must be compatible with the license of APQ.

You could use my version of this library:

 http://home.t-online.de/home/christ-usch.grein/Ada/Safe_Pointers.html

It was published in Ada User Journal, Volume 20, Number 2 (Juli 1999)
and as a reprint in Ada Letters, Volume XIX, Number 4, December 1999. 
It's in a very liberal license.
__________________________________________________________
Mit WEB.DE FreePhone mit hoechster Qualitaet ab 0 Ct./Min.
weltweit telefonieren! http://freephone.web.de/?mc=021201




^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2005-01-05 11:58 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-15 23:31 APQ Brian May
2004-12-16 11:34 ` APQ Warren W. Gay VE3WWG
2004-12-16 23:58   ` APQ Randy Brukardt
2004-12-17  3:45     ` APQ Brian May
2004-12-17  4:03       ` APQ Warren W. Gay VE3WWG
2004-12-17  4:38         ` APQ Brian May
2004-12-17  9:06           ` APQ Egil H. H�vik
2004-12-17 11:42             ` APQ Brian May
2004-12-17 22:55               ` APQ Brian May
2004-12-18 15:52                 ` APQ Warren W. Gay VE3WWG
2004-12-18 18:23                   ` APQ Dmitry A. Kazakov
2004-12-21 23:34                     ` APQ Brian May
2004-12-22  8:57                       ` APQ Dmitry A. Kazakov
2004-12-22 10:07                   ` APQ Martin Krischik
2004-12-22 13:15                     ` APQ Dmitry A. Kazakov
2004-12-22 16:53                       ` APQ Martin Krischik
2004-12-22 17:21                         ` APQ Dmitry A. Kazakov
2004-12-22 18:23                           ` APQ Martin Krischik
2004-12-17  8:59       ` APQ Stephen Leake
2004-12-17 14:12       ` APQ Dmitry A. Kazakov
2004-12-17 23:20         ` APQ Brian May
2004-12-18 16:13           ` APQ Dmitry A. Kazakov
2004-12-21 23:29         ` APQ Brian May
2004-12-22  9:14           ` APQ Dmitry A. Kazakov
2005-01-04 21:32             ` APQ Brian May
2005-01-05 11:58               ` APQ Dmitry A. Kazakov
2004-12-23 17:04           ` APQ (Connection Cloning) Warren W. Gay VE3WWG
2004-12-23 17:55             ` Georg Bauhaus
2004-12-23 18:52               ` Warren W. Gay VE3WWG
2005-01-03  7:40                 ` Frank Piron
2004-12-17 13:54 ` APQ Dmitry A. Kazakov
  -- strict thread matches above, loose matches on Subject: below --
2004-12-16  4:37 APQ Christoph Karl Walter Grein

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