comp.lang.ada
 help / color / mirror / Atom feed
From: Christopher Browne <cbbrowne@acm.org>
Subject: Re: databases written in ada
Date: 10 Aug 2002 05:13:17 GMT
Date: 2002-08-10T05:13:17+00:00	[thread overview]
Message-ID: <aj27dc$18gndv$1@ID-125932.news.dfncis.de> (raw)
In-Reply-To: 3D547FFD.3030808@cogeco.ca

The world rejoiced as "Warren W. Gay VE3WWG" <ve3wwg@cogeco.ca> wrote:
> tony wrote:
>  > but in which when something is stored then it is automatically
>  > stored to disk as well as being available in memory
>
> This comment, as worded, is difficult to understand precisely. APQ
> as well as any other Ada binding to an SQL database gives you the
> opportunity to insert rows, perform updates, perform deletes, or
> perform SELECT queries and retrieve results. There is also the GNADE
> project, which gives you the ability to do "embedded SQL" in Ada
> terms.

The comment is fairly readily understood, as it is commonly known in
OS literature by the term "orthogonal persistence."

The idea is that you have a set of datatypes which essentially "store
themselves."  

You don't have to do a "select" or "insert" or "update" in order to
get/put values.

Instead, by virtue of simply having a declaration like:

  value1, value2 : INTEGER;

Those values are directly tied to the database.

If you have the code:

  value1 := 25;
  value2 := 17;
  value1 := value1 + value2;

This would, behind the scenes, intersperse the assignments with
queries that might resemble:

  insert into int_table (key, value) values ('value1', 25);
  insert into int_table (key, value) values ('value2', 17);
  update int_table set value = 32 where key = 'value1';

It is quite common to set up database-backed classes in Java and C++
that create this sort of tie between objects and SQL databases.

The cool part is that if the program were shut down, you could [by
some Really Complex magic I'll not imagine too hard about] see the
program start back up, and continue where it left off, with the
various variables holding their database-backed values.

Presumably you could create an Ada class that would allow doing
something sort of like this.  

Presumably you'd not want _all_ variables database-backed, as
performance would Suck Spectacularly.  But it's a pretty normal
exercise using JDBC to design classes to let you define some
"database-backed variables."

It probably ought to be left as an exercise for the reader :-)
-- 
(reverse (concatenate 'string "moc.enworbbc@" "sirhc"))
http://www3.sympatico.ca/cbbrowne/linux.html
"So, does this mean goodbye to the "Bluescreen of Death" and hello to
the "Bluescreen of Holy Vengeance?"" -- Observed on Slashdot after
hearing Al Qaeda terrorists may have hacked on Windows XP...



  parent reply	other threads:[~2002-08-10  5:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3D53CE34.45F25F4@btinternet.com>
2002-08-10  7:20 ` databases written in ada Caffeine Junky
     [not found] ` <3D547FFD.3030808@cogeco.ca>
2002-08-10  5:13   ` Christopher Browne [this message]
2002-08-10  9:13     ` Florian Weimer
2002-08-10 15:22       ` Christopher Browne
2002-08-11 13:20         ` Florian Weimer
2002-08-11 17:34   ` Heikki Tuuri
2002-08-15 22:02     ` Poutanen Olavi
replies disabled

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