comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov>
Subject: Re: Use of XML for config files
Date: 20 Jun 2002 10:38:00 -0400
Date: 2002-06-20T14:45:40+00:00	[thread overview]
Message-ID: <uwusut3qv.fsf@gsfc.nasa.gov> (raw)
In-Reply-To: aeqs83$sbc$1@a1-hrz.uni-duisburg.de

Georg Bauhaus <sb463ba@l1-hrz.uni-duisburg.de> writes:

> Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov> wrote:
> : Can you give more detail about what is missing?
> : not clear what operations are implied by "administer". 
> 
> "administer" was just a very bad choice for a word, please
> forget.

Ok.

> There is one thing that isn't missing but--from some perspective--
> might be too much. (So I could just not use it and be done with it,
> of course, so what? ) There are generics for read/write of several
> kinds of types. But the API could as well shift the responsibility
> for interpretive reading and writing of textual and Ada
> representation of data to the application, or another package.
> (That's not a new thought I guess?) For example, it might be that
> different people have different habits for writing floating point
> numbers, e.g. money values, percent character, etc.

They can do that now by writing to a string, and calling Write_String.
Or, we could add something like:

generic
   type Private_Type is private;
   with function To_String (Item : in Private_Type) return String;
procedure Write_Private
  (Config         : in out Configuration_Type;
   Key            : in     String;
   Value          : in     Private_Type;
   Error_Handling : in     Error_Handling_Type := Ignore);
   
I had that in originally, but took it out because it seemed to
encourage people to use a non-standard format in the config file. But
since people can get around that by just calling Write_String, maybe
it's worth putting back in.

Although I gather you are saying you'd be happy if I _only_ had
Write_String, without any generics.

> :>   where the text of the explanation is written by non-programmers. I
> :>   can now, but my conf keys will look like x.y.de_CH, x.y.fr_FR etc.
> : 
> : Why is that bad? Your code would be:
> : explanation (property (x, "y." & Current_Language));
> : Not much different, and makes the standard Config_Files library much
> : simpler.
> 
> It's not at all bad in an application program. 
> (The only time I was worried about x.y.de_CH used as a key _in
> the application_ was when de_CH is not unique as it is here,
> but needs to be named. But this can be done by introducing
> another section, x.y.lang.de_CH.)

Ok. So I think you agree the current spec is ok here, and we don't
need to add anything special for languages (or "localization" in
general). 

> : Um, what do you mean by "internal"? In both of my proposed specs,
> : the user must specify "x.y.de_CH". The keys are visible.
> 
> I mean that I could possibly map "x.y.de_CH", or with the above,
> "x.y.lang.de_CH" to either it's identity in a properties
> file, or to <x><y lang="de_CH">...</y></x> in an XML file.

Well, yes, we could define a special support for languages in XML. I
don't see how it's worth it, in the Config_File context.

> I'm fiddling with this and XML/Ada using the already present DOM
> representation and the Config_Files interfaces. Would it make sense
> to bring Grace.Config_Files_* to another hierarchical level so the
> interface (e.g. as specified in Config_Files_Java) would be
> implemented in different ways in child packages?

I'd like to have one standard file format. You can always add a child
package to implement a non-standard format. I wouldn't mind moving
enough of the body into the private part of the spec to make that
easier. 

> : The Config_Files requirements assume that everyone is "familiar"
> : with simple text editors. If your users are not, then you should
> : not be using Config_Files, or you should provide a different tool
> : for the users to edit them with.
> 
> Yes, exactly that is one of the strong arguments I see for
> XML support. (Perhaps) optimistically, all I have to do is to send
> them a suitable DTD, and a validating XML editor.

Well, if you have a "validating XML editor" sitting around, that would
make things easy. I didn't think such things existed.

In the absence of that, I don't think it's very hard to build a
special editor for config files using the Java property format. Come
to think of it, somebody in the Java community has probably done just
that. 

> I won't have to write an application that sets everything up one
> their computer so they can write relatively sane configuration
> files. (not sure whether this is applicable for the average Ada
> program users, so maybe not an issue.)

The idea is that the installer for the app using the config file
writes a "sane" config file. Then the user can edit it if they need to
(like if their Windows disks get renamed). 

You do have to write the installer for your app.

> :> Well, OTOH, file formats do have consequences for what you can
> :> reasonably want to be present in an API don't they?
> : 
> : You have said exactly the opposite, just 17 lines above.
> 
> Uhm, I said "it should look like", there is a difference :-)

Well, the goal is that the API is independent of the file format. If
we choose ini files, we can't have mult-level keys; that is one impact
on the API. Other than that, I have not seen any impact of the file
format on the API, given the other requirements on the API.

-- 
-- Stephe



  reply	other threads:[~2002-06-20 14:38 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-03 11:48 Use of XML for config files Mike and Lynn Card
2002-06-03 17:42 ` Pascal Obry
2002-06-04  6:26 ` Volkert Barr
2002-06-04 12:47   ` SteveD
2002-06-04 13:51     ` Volkert Barr
2002-06-04 19:29   ` Ted Dennison
2002-06-05  7:18     ` Volkert Barr
2002-06-05 10:24       ` Georg Bauhaus
2002-06-05 11:35         ` Preben Randhol
2002-06-05 14:52           ` Georg Bauhaus
2002-06-05 15:22             ` Preben Randhol
2002-06-05 19:11             ` Darren New
2002-06-06 13:38               ` Georg Bauhaus
2002-06-06 15:06                 ` Darren New
2002-06-07 11:28                   ` Georg Bauhaus
2002-06-07 17:10                     ` Darren New
2002-06-06  6:48           ` Volkert Barr
2002-06-06 13:27             ` Georg Bauhaus
2002-06-05 14:41       ` Robert C. Leif
2002-06-09 22:00     ` Stephen Leake
2002-06-10 15:03       ` Ted Dennison
2002-06-10 18:12         ` Stephen Leake
2002-06-12 11:25         ` Georg Bauhaus
2002-06-12 15:33           ` Darren New
2002-06-12 17:53             ` Stephen Leake
2002-06-13 14:18               ` Ted Dennison
2002-06-13 16:36                 ` Stephen Leake
2002-06-14  3:27                   ` Ted Dennison
2002-06-14 15:54                     ` Stephen Leake
2002-06-12 19:18             ` Georg Bauhaus
2002-06-13 13:53             ` Ted Dennison
2002-06-13 15:26               ` Georg Bauhaus
2002-06-13 16:39               ` Darren New
2002-06-13 17:06                 ` Georg Bauhaus
2002-06-13 17:43                   ` Darren New
2002-06-14 15:56                     ` Georg Bauhaus
2002-06-13 17:54                 ` Georg Bauhaus
2002-06-13 18:31                   ` Darren New
2002-06-14 16:04                     ` Stephen Leake
2002-06-14 16:48                       ` Darren New
2002-06-14 17:03                     ` Georg Bauhaus
2002-06-14 17:22                       ` Darren New
2002-06-18 15:20                         ` Georg Bauhaus
2002-06-18 15:37                           ` Darren New
2002-06-18 18:20                             ` Georg Bauhaus
2002-06-18 19:11                               ` Stephen Leake
2002-06-18 21:47                               ` Darren New
2002-06-19 11:31                                 ` Georg Bauhaus
2002-06-19 15:13                                   ` Stephen Leake
2002-06-19 21:14                                     ` Georg Bauhaus
2002-06-20 14:38                                       ` Stephen Leake [this message]
2002-06-20 16:02                                         ` Georg Bauhaus
2002-06-20 20:37                                           ` Stephen Leake
2002-06-21 16:24                                             ` Ted Dennison
2002-06-24 14:11                                               ` Stephen Leake
2002-06-19 16:43                                   ` Darren New
2002-06-19 20:33                                     ` Georg Bauhaus
2002-06-12 17:48           ` Stephen Leake
2002-06-13  7:42             ` Tarjei T. Jensen
2002-06-13 13:53               ` Georg Bauhaus
2002-06-13 14:10               ` Stephen Leake
2002-06-13 16:50                 ` Warren W. Gay VE3WWG
2002-06-13 17:31                   ` Tarjei Tj�stheim Jensen
2002-06-14 16:11                   ` Stephen Leake
2002-06-13 17:28                 ` Tarjei Tj�stheim Jensen
2002-06-19  9:48                   ` Preben Randhol
2002-06-10 14:45     ` Georg Bauhaus
2002-06-09 21:52   ` Stephen Leake
2002-06-10  0:02     ` Preben Randhol
2002-06-10 12:42       ` Stephen Leake
2002-06-10 16:21         ` Pascal Obry
2002-06-12 11:29           ` Georg Bauhaus
  -- strict thread matches above, loose matches on Subject: below --
2002-06-05  7:33 Grein, Christoph
2002-06-05  7:59 ` Volkert Barr
2002-06-05  8:25 Grein, Christoph
2002-06-05  8:39 ` Volkert Barr
2002-06-05  9:31 ` Manuel Collado
2002-06-05 10:01   ` Volkert Barr
2002-06-05 10:02 Grein, Christoph
2002-06-09 22:13 ` Stephen Leake
2002-06-10  1:42   ` Darren New
2002-06-10 12:46     ` Stephen Leake
2002-06-10 15:52       ` Darren New
replies disabled

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