Using jar-built-in and outside configuration

Discussion in 'Java' started by wx, Sep 16, 2008.

  1. wx

    wx Guest

    I have an application that needs some configuration stored (e.g. a
    path to the default folder where all projects are stored). What is the
    best way (but still relatively easy) to store this? Did anybody do the
    analysis of the possible methods? I've read about some of them:
    - A file (Java properties or similar - xml, ini, yaml, whatever)
    - A database (though, I need the connection parameters in that case)
    - Directory server (e.g. LDAP)
    - Service (Web service or Java application server-like service (e.g.
    JBoss service))

    These are the things I'd like to achieve:
    - The application should have the default values if no other value is
    found (e.g. for the first start)
    - It will be a jar, so the configuration cannot be (easily) changed if
    it is stored in the source or files within jar. Thus, there should
    have an external way to change them. For example, a properties file in
    the jar folder or user's home. This is the first important thing - the
    user should be able to change the configuration without too much
    hassle. He should also be able to change the location of the
    configuration easily. If it is e.g. a file in some write protected
    folder (e.g. network share), he should be able to override this and
    put it somewhere else (e.g. his home folder or something). If this
    could be the default, even better.
    - My second important thing is - the configuration should be easily
    changeable. I don't care if I need to edit files, that is very
    efficient for me, I'd say much better then going through some
    preferences dialogs. I.e. speed is the key. Whatever is faster is
    probably better.
    - It is the advantage if the thing is portable. E.g. using files or
    databases is probably very portable, while using e.g. Windows Registry
    is completely unportable
    - What I said above is just my look at the things. I'd like to see
    other solutions - maybe I will see something different and better,
    even though some of the above might not be satisfied

    Do you have any experience with this? If so, what was the method you
    used? What were the pros and cons of your method?

    If you have any URL to some document describing various methods + pros
    and cons, please post it here.
    wx, Sep 16, 2008
    #1
    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. Arnold Peters
    Replies:
    0
    Views:
    568
    Arnold Peters
    Jan 5, 2005
  2. muttley
    Replies:
    0
    Views:
    2,719
    muttley
    Oct 20, 2005
  3. cyberco
    Replies:
    4
    Views:
    3,754
    Roedy Green
    Feb 14, 2006
  4. Arnold Peters
    Replies:
    0
    Views:
    657
    Arnold Peters
    Jan 5, 2005
  5. Dave Angel
    Replies:
    6
    Views:
    222
    Terry Reedy
    Nov 1, 2011
Loading...

Share This Page