Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #22950

Re: regexp(ing) Backus-Naurish expressions ...

From Arved Sandstrom <asandstrom2@eastlink.ca>
Newsgroups comp.lang.java.programmer
Subject Re: regexp(ing) Backus-Naurish expressions ...
References <khqsie$jee$1@speranza.aioe.org> <5140fb94$0$32106$14726298@news.sunsite.dk>
Message-ID <sy70t.279596$EO2.53348@newsfe04.iad> (permalink)
Organization Public Usenet Newsgroup Access
Date 2013-03-13 20:00 -0300

Show all headers | View raw


On 03/13/2013 07:20 PM, Arne Vajhøj wrote:
> On 3/13/2013 5:54 PM, qwertmonkey@syberianoutpost.ru wrote:
>> Arne Vajhøj schrieb:
>>> I would do it as:
>>> - switch from properties to XML
>>> - define a schema for the XML with strict restrictions on data
>>> - let the application parse that with a validating parser and
>>>     read it into some config object, this will ensure that required
>>>     information is there and that the data types are correct
>>> - let the application apply business validation rules in Java code
>>>     on the config objects - this will ensure that the various
>>>     information is consistent
>> ~
>>   Arne, what do you specifically mean when you say "read it into some
>> config object"? Using JAXB? AFAIK JAXB needs source (re)compilation in
>> Android:
>
> JAXB is on way to get from XML to Java objects.
>
> But there are plenty of other. W3C DOM, SAX, StAX, JDOM etc.. I would
> expect some of them to be available on Android.
>
>>   Also I am trying to deal with it in a general "named-value" pair
>> way, so that
>> different schema files should be parsed and the result (as I see it)
>> should
>> be some String[*][2] with the names and values of parameters/properties
>
> Anything that can be represented in a properties file should be
> possible to represent in a XML file. And most likely in a more
> structured way.
>
> Arne
>
>
However, many people - myself included - may find a properties file 
easier to read than XML.

Also, XML no more gives you a _good_ hierarchy - which requires thought 
- than a properties file with well-designed keys. Keys for properties 
files for several Java loggers are examples of how they can be used to 
easily define a hierarchy.

It's easier to read in a properties file.

Back in the day, not in the Java environment admittedly, I used to 
prefer YAML to XML for properties files.

AHS

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

regexp(ing) Backus-Naurish expressions ... qwertmonkey@syberianoutpost.ru - 2013-03-13 21:54 +0000
  Re: regexp(ing) Backus-Naurish expressions ... markspace <markspace@nospam.nospam> - 2013-03-13 15:12 -0700
  Re: regexp(ing) Backus-Naurish expressions ... Arne Vajhøj <arne@vajhoej.dk> - 2013-03-13 18:20 -0400
    Re: regexp(ing) Backus-Naurish expressions ... Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-03-13 20:00 -0300
      Re: regexp(ing) Backus-Naurish expressions ... Arne Vajhøj <arne@vajhoej.dk> - 2013-03-14 21:16 -0400
        Re: regexp(ing) Backus-Naurish expressions ... Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-03-15 06:31 -0300
          Re: regexp(ing) Backus-Naurish expressions ... Lew <lewbloch@gmail.com> - 2013-03-15 11:34 -0700
            Re: regexp(ing) Backus-Naurish expressions ... Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-03-15 20:17 -0300
  Re: regexp(ing) Backus-Naurish expressions ... Leif Roar Moldskred <leifm@dimnakorr.com> - 2013-03-13 17:47 -0500

csiph-web