Velocity Reviews

Velocity Reviews (
-   Java (
-   -   Using jar-built-in and outside configuration (

wx 09-16-2008 04:23 PM

Using jar-built-in and outside configuration
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.

All times are GMT. The time now is 06:01 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.