Using jar-built-in and outside configuration

W

wx

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top