config file processing

Discussion in 'Java' started by farseer, Apr 25, 2005.

  1. farseer

    farseer Guest

    I have been reading up on the various means of dealing with config
    files. I like the idea of persisting an object that encapsulates the
    configuration data i am trying to read or save.

    I like to ask for some advice or opinions on the following...what are
    the Pro's vs. Cons from any one that has experience with these.

    -java.beans.XMLEncoder and java.beans.XMLDecoder
    -Castor
    -Jaxb
    -JDom

    obviously there are siginificant differences between these, but i would
    like to know what the guru's are doing when it comes to dealing with
    config files? in my case, i am working on an Applet, so the config file
    will be streamed to me.

    thanks much
     
    farseer, Apr 25, 2005
    #1
    1. Advertising

  2. farseer

    Ross Bamford Guest

    On Sun, 2005-04-24 at 23:27 -0700, farseer wrote:
    > I have been reading up on the various means of dealing with config
    > files.
    >
    > ...
    >
    > obviously there are siginificant differences between these, but i would
    > like to know what the guru's are doing when it comes to dealing with
    > config files? in my case, i am working on an Applet, so the config file
    > will be streamed to me.
    >
    > thanks much
    >


    Check out the Apache Commons Digester:

    http://jakarta.apache.org/commons/digester

    This is an excellent tool that generates an object hierarchy from an XML
    stream. Theres a small learning curve - it looks complicated to begin
    with but the docs are excellent and once you get it it's easy.

    See:

    http://jamecs.sourceforge.net/docs/jad/xref/org/roscopeco/jamecs/jad/context/StandardConfig.html

    For an example of using it in a real project.

    Cheers,
    Ross


    --
    [Ross A. Bamford] [9.co.uk]
    Roscopeco Open Tech ++ Open Source + Java + Apache + CMF
    http://www.roscopec0.f9.co.uk/ + 9.co.uk
     
    Ross Bamford, Apr 25, 2005
    #2
    1. Advertising

  3. farseer wrote:
    > i am working on an Applet, so the config file
    > will be streamed to me.


    For me this would be the reason not to go with persistent objects for
    configuration data, but with a simple properties file, to keep the data
    small and reasonable.

    /Thomas


    --
    The comp.lang.java.gui FAQ:
    ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
     
    Thomas Weidenfeller, Apr 25, 2005
    #3
  4. farseer

    Marcus Eaton Guest

    Thomas Weidenfeller wrote:

    > farseer wrote:
    >
    >> i am working on an Applet, so the config file
    >> will be streamed to me.

    >
    >
    > For me this would be the reason not to go with persistent objects for
    > configuration data, but with a simple properties file, to keep the
    > data small and reasonable.
    >
    > /Thomas
    >
    >

    I agree. Unless you're trying to persist state, as opposed to config
    data, then stick with properties files for a tried and true method

    Marcus
     
    Marcus Eaton, Apr 25, 2005
    #4
  5. farseer

    Ross Bamford Guest

    On Mon, 2005-04-25 at 13:34 +0000, Marcus Eaton wrote:
    > Thomas Weidenfeller wrote:
    >
    > > farseer wrote:
    > >
    > >> i am working on an Applet, so the config file
    > >> will be streamed to me.

    > >
    > >
    > > For me this would be the reason not to go with persistent objects for
    > > configuration data, but with a simple properties file, to keep the
    > > data small and reasonable.
    > >
    > > /Thomas
    > >
    > >

    > I agree. Unless you're trying to persist state, as opposed to config
    > data, then stick with properties files for a tried and true method
    >
    > Marcus


    Good point ... I missed the applet part and just ran with XML config ;)

    At 150-ish K digester isn't exactly applet sized :)

    sorry!

    Ross
     
    Ross Bamford, Apr 25, 2005
    #5
    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. Hubert Hung-Hsien Chang
    Replies:
    2
    Views:
    540
    Michael Foord
    Sep 17, 2004
  2. CSharpner
    Replies:
    0
    Views:
    1,135
    CSharpner
    Apr 9, 2007
  3. M Irfan
    Replies:
    2
    Views:
    3,996
    M Irfan
    Apr 18, 2007
  4. Ollie Riches
    Replies:
    1
    Views:
    1,688
    Gregory A. Beamer
    Dec 4, 2008
  5. kampy
    Replies:
    9
    Views:
    371
    Steven D'Aprano
    Oct 19, 2012
Loading...

Share This Page