comp.lang.ada
 help / color / mirror / Atom feed
* A little database
@ 2002-11-15  7:01 Victor Porton
  2002-11-15  9:31 ` Preben Randhol
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Victor Porton @ 2002-11-15  7:01 UTC (permalink / raw)


I want to keep a little database (containing information about several 
Web sites) on the disk.

It is desirable (but not necessary) to have the file format 
portable among platforms and compilers (however I use only GNAT).

In your opinion, All, should I use XML or just 'Read/'Write etc. 
attributes? Or may be there are a special Ada library for such small 
databases in disk files?

Well, the database shall be editable by the user with my GUI.



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

* Re: A little database
  2002-11-15  7:01 A little database Victor Porton
@ 2002-11-15  9:31 ` Preben Randhol
  2002-11-15 10:10 ` Georg Bauhaus
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Preben Randhol @ 2002-11-15  9:31 UTC (permalink / raw)


Victor Porton wrote:
> I want to keep a little database (containing information about several 
> Web sites) on the disk.
> 
> It is desirable (but not necessary) to have the file format 
> portable among platforms and compilers (however I use only GNAT).
> 
> In your opinion, All, should I use XML or just 'Read/'Write etc. 
> attributes? Or may be there are a special Ada library for such small 
> databases in disk files?
> 
> Well, the database shall be editable by the user with my GUI.

You can use the XML/Ada library : http://libre.act-europe.fr/xmlada/

And if you make a nice GtkAda widget for dealing with editing a general
XML file and share it with the rest of use we would be very happy :-)

I guess you don't have to use XML, but there are many tools that deal
with XML that can be nice to use. It depends really on how much data and
how structured you need this data to be.

-- 
Preben Randhol ------------------------ http://www.pvv.org/~randhol/ --
�There are three things you can do to a woman. You can love her, suffer
 for her, or turn her into literature.�  - Justine, by Lawrence Durrell



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

* Re: A little database
  2002-11-15  7:01 A little database Victor Porton
  2002-11-15  9:31 ` Preben Randhol
@ 2002-11-15 10:10 ` Georg Bauhaus
  2002-11-15 19:02 ` Pascal Obry
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Georg Bauhaus @ 2002-11-15 10:10 UTC (permalink / raw)


Victor Porton <porton@ex-code.com> wrote:
: It is desirable (but not necessary) to have the file format 
: portable among platforms and compilers (however I use only GNAT).

Is an RDMS an option? If so have a look at GNADE at sourceforge.




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

* Re: A little database
  2002-11-15  7:01 A little database Victor Porton
  2002-11-15  9:31 ` Preben Randhol
  2002-11-15 10:10 ` Georg Bauhaus
@ 2002-11-15 19:02 ` Pascal Obry
  2002-11-15 21:48 ` Ted Dennison
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Pascal Obry @ 2002-11-15 19:02 UTC (permalink / raw)



porton@ex-code.com (Victor Porton) writes:

> I want to keep a little database (containing information about several 
> Web sites) on the disk.

For a small "databases", you could use GDBM. I have a binding for Ada on
my homepage. GDBM works fine on Windows and all UNIXes.

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|         http://perso.wanadoo.fr/pascal.obry
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595



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

* Re: A little database
  2002-11-15  7:01 A little database Victor Porton
                   ` (2 preceding siblings ...)
  2002-11-15 19:02 ` Pascal Obry
@ 2002-11-15 21:48 ` Ted Dennison
  2002-11-16 11:20   ` Pascal Obry
  2002-11-23 20:13 ` Michael Erdmann
  2002-11-26  5:46 ` Victor Porton
  5 siblings, 1 reply; 12+ messages in thread
From: Ted Dennison @ 2002-11-15 21:48 UTC (permalink / raw)


porton@ex-code.com (Victor Porton) wrote in message news:<3dd49c15$0$303$bed64819@news.gradwell.net>...
> I want to keep a little database (containing information about several 
> Web sites) on the disk.
> 
> It is desirable (but not necessary) to have the file format 
> portable among platforms and compilers (however I use only GNAT).
> 
> In your opinion, All, should I use XML or just 'Read/'Write etc. 
> attributes? Or may be there are a special Ada library for such small 
> databases in disk files?
> 
> Well, the database shall be editable by the user with my GUI.

For a database, the most sensible portable format would be CSV. That
way it can be imported, exported, edited, and manipulated with any
database or spreadsheet tool you users might have or want (even a text
editor). Unless you have complicated hierarchal relationships that
can't be easily expressed in tabular format, XML is overkill (and
relatively poorly supported overkill, at that).

I don't know of any Ada support for creating CSV's, but the format is
trivial to generate with standard Text_IO calls, and OpenToken
(http://www.telepath.com/~dennison/Ted/OpenToken/OpenToken.html ) has
support for parsing it.



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

* Re: A little database
  2002-11-15 21:48 ` Ted Dennison
@ 2002-11-16 11:20   ` Pascal Obry
  2002-11-18 15:01     ` Ted Dennison
  0 siblings, 1 reply; 12+ messages in thread
From: Pascal Obry @ 2002-11-16 11:20 UTC (permalink / raw)



dennison@telepath.com (Ted Dennison) writes:

> For a database, the most sensible portable format would be CSV. That
> way it can be imported, exported, edited, and manipulated with any
> database or spreadsheet tool you users might have or want (even a text
> editor). Unless you have complicated hierarchal relationships that
> can't be easily expressed in tabular format, XML is overkill (and
> relatively poorly supported overkill, at that).

Overkill at first sight... but with XML you can parse, validate, publish or
whatever... This is the same argument that say that Ada is overkill compared
to C!

> I don't know of any Ada support for creating CSV's, but the format is

I have a Text_Key_File component on my homepage that does just that. Handle a
file where each line is composed of fields. The separator can be
configured. Not also that this is a job that is easy to do with GNAT.AWK.

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|         http://perso.wanadoo.fr/pascal.obry
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595



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

* Re: A little database
  2002-11-16 11:20   ` Pascal Obry
@ 2002-11-18 15:01     ` Ted Dennison
  2002-11-25 19:13       ` Georg Bauhaus
  0 siblings, 1 reply; 12+ messages in thread
From: Ted Dennison @ 2002-11-18 15:01 UTC (permalink / raw)


Pascal Obry <p.obry@wanadoo.fr> wrote in message news:<u8yztg3ra.fsf@wanadoo.fr>...
> Overkill at first sight... but with XML you can parse, validate, publish or
> whatever... 

Not with anything already installed on the PC. However, anyone with
Office (or any competing productivity suite) has numerous tools to
deal with CSV, including plotting, graphing, querying, and reporting
tools. What's more, most users are already familiar with using those
tools.



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

* Re: A little database
  2002-11-15  7:01 A little database Victor Porton
                   ` (3 preceding siblings ...)
  2002-11-15 21:48 ` Ted Dennison
@ 2002-11-23 20:13 ` Michael Erdmann
  2002-11-26  5:46 ` Victor Porton
  5 siblings, 0 replies; 12+ messages in thread
From: Michael Erdmann @ 2002-11-23 20:13 UTC (permalink / raw)


Victor Porton wrote:

> I want to keep a little database (containing information about several
> Web sites) on the disk.
> 
> It is desirable (but not necessary) to have the file format
> portable among platforms and compilers (however I use only GNAT).
> 
> In your opinion, All, should I use XML or just 'Read/'Write etc.
> attributes? Or may be there are a special Ada library for such small
> databases in disk files?
> 
> Well, the database shall be editable by the user with my GUI.

It depends how dynamic your data will be and how complex your 
queries will be.

If it is just 50 updates per day and you are doing retrieving 
you data based on simple <key,value> pair queries using XML
will be the best idea.

If it comes to more complex queries and issues like concurent 
writing, record locking and transaction rates > 1 transaction
per min. i would always recommend the usage of a real relational
database like posesql via ODBC(e.g. see http://gnade.sourceforge.net).


Regards
   M.Erdmann




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

* Re: A little database
  2002-11-18 15:01     ` Ted Dennison
@ 2002-11-25 19:13       ` Georg Bauhaus
  2002-11-25 22:00         ` achrist
  0 siblings, 1 reply; 12+ messages in thread
From: Georg Bauhaus @ 2002-11-25 19:13 UTC (permalink / raw)


Ted Dennison <dennison@telepath.com> wrote:
:  However, anyone with
: Office (or any competing productivity suite) has numerous tools to
: deal with CSV, 

The downside of MS's CSV handling is that the producer of CSVs
must follow their notion os CSV very closely. One must not put
spaces after the C, one should remember what happens if the
text indicating character appears in the original text of a
column, one must make sure that the option of combining two adjecent
C into one isn't turned on, there is no easy way to indicate
the data format of some text, other than interactively adjust
settings, afaics...

Some of these problems go away with XML, and it is almost trivial
to produce CSVs from XML using XSLTs. XML Libraries exist on any
recent Windows(TM) OS.

-- georg
---
Microsoft Windows--a fresh perspective on information hiding



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

* Re: A little database
  2002-11-25 19:13       ` Georg Bauhaus
@ 2002-11-25 22:00         ` achrist
  2002-11-26 10:39           ` Georg Bauhaus
  0 siblings, 1 reply; 12+ messages in thread
From: achrist @ 2002-11-25 22:00 UTC (permalink / raw)


Georg Bauhaus wrote:
> Some of these problems go away with XML, and ...

Can you point to any sample applications (in Ada) with source code
on-line that make good use of database-like data (equivalent to
multiple tables related to each other) stored in XML? I've taken some
attempt at that using MSXML, and what I wrote worked, but it was ugly.
In particular, when updating the parent of a parent-child relationship
(where the XML has the children in-line within the parent) I had to
replace the entire parent + children, passing the entire subtree as a
single string to MSXML.

Are there newer API's (MSXML2 or ???) that provide for better features
for updating XML? MSXML didn't seem to be designed with updates in mind.

For single-user databases, Metakit looks to be a nice one.  It 
works with Tcl, and there are some interfaces between Ada and Tcl.
Has anyone connected Ada to Metakit?


Al



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

* Re: A little database
  2002-11-15  7:01 A little database Victor Porton
                   ` (4 preceding siblings ...)
  2002-11-23 20:13 ` Michael Erdmann
@ 2002-11-26  5:46 ` Victor Porton
  5 siblings, 0 replies; 12+ messages in thread
From: Victor Porton @ 2002-11-26  5:46 UTC (permalink / raw)


In article <3DE29D8B.68CAC0A@easystreet.com>,
	achrist@easystreet.com writes:
> Georg Bauhaus wrote:
> 
> Are there newer API's (MSXML2 or ???) that provide for better features
> for updating XML? MSXML didn't seem to be designed with updates in mind.

Try XMLAda (also knwon as XML/Ada).



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

* Re: A little database
  2002-11-25 22:00         ` achrist
@ 2002-11-26 10:39           ` Georg Bauhaus
  0 siblings, 0 replies; 12+ messages in thread
From: Georg Bauhaus @ 2002-11-26 10:39 UTC (permalink / raw)


achrist@easystreet.com wrote:
: 
: In particular, when updating the parent of a parent-child relationship
: (where the XML has the children in-line within the parent) I had to
: replace the entire parent + children, passing the entire subtree as a
: single string to MSXML.
: 
: Are there newer API's (MSXML2 or ???) that provide for better features
: for updating XML? MSXML didn't seem to be designed with updates in mind.

That's very likely; XML doesn't seem to be designed with updates in
mind either. Given that it is used for passing data around, and in
particular, is used in translations, and given that the corresponding
standard (DSSSL, now XSLT) uses Scheme and a functional approach,
you construct one doucment tree from another, using subtrees as in
your case (if I've understood correctly) to make changes.

However, if that isn't tolerable, for example if you don't have enough
memory for a full DOM tree etc, you are free to build your own data
structure as with any other data input.

-- georg



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

end of thread, other threads:[~2002-11-26 10:39 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-15  7:01 A little database Victor Porton
2002-11-15  9:31 ` Preben Randhol
2002-11-15 10:10 ` Georg Bauhaus
2002-11-15 19:02 ` Pascal Obry
2002-11-15 21:48 ` Ted Dennison
2002-11-16 11:20   ` Pascal Obry
2002-11-18 15:01     ` Ted Dennison
2002-11-25 19:13       ` Georg Bauhaus
2002-11-25 22:00         ` achrist
2002-11-26 10:39           ` Georg Bauhaus
2002-11-23 20:13 ` Michael Erdmann
2002-11-26  5:46 ` Victor Porton

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