regexp(ing) Backus-Naurish expressions ...

Discussion in 'Java' started by qwertmonkey@syberianoutpost.ru, Mar 14, 2013.

  1. Guest

    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.

    ~
    My favorite way to go about this is using SAX with validation and custom
    handlers which entend an abstract class, so you can load and use them
    as some sort of array of command objects via an index
    ~
    >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.

    ~
    yes, but we are talking users here and the similarity between command-line
    options and properties files is obvious compared to xml
    ~
    lbrtchx
    , Mar 14, 2013
    #1
    1. Advertising

  2. Arne Vajhøj Guest

    On 3/14/2013 4:00 AM, 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.

    > ~
    > My favorite way to go about this is using SAX with validation and custom
    > handlers which entend an abstract class, so you can load and use them
    > as some sort of array of command objects via an index
    > ~
    >> 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.

    > ~
    > yes, but we are talking users here and the similarity between command-line
    > options and properties files is obvious compared to xml


    If it is non-IT people, then that is an argument for properties
    files over XML.

    Arne
    Arne Vajhøj, Mar 15, 2013
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kenneth Brody

    Sorta-OT: John Backus obit

    Kenneth Brody, Mar 21, 2007, in forum: C Programming
    Replies:
    5
    Views:
    294
    Nick Keighley
    Mar 22, 2007
  2. Jesse Merriman

    Backus, Functional Programming, and Ruby

    Jesse Merriman, Mar 25, 2007, in forum: Ruby
    Replies:
    10
    Views:
    228
    Giles Bowkett
    Mar 26, 2007
  3. Joao Silva
    Replies:
    16
    Views:
    359
    7stud --
    Aug 21, 2009
  4. Replies:
    23
    Views:
    534
    Robert Klemme
    Mar 13, 2013
  5. Replies:
    7
    Views:
    296
    Arved Sandstrom
    Mar 15, 2013
Loading...

Share This Page