Please join us at the new JavaWorld Q&A Forums. Your existing login will work there. The discussions here are now read-only.


JavaWorld Talkback >> 958382

Catalin
stranger


Reged: 08/18/03
Posts: 4
Small inconvenience with classpath
      08/18/03 09:17 AM

Hi,

I agree with the author that loading properties from a file using file access classes is not a really good idea.
However, here is a problem I've run into with properties loaded from classpath.

First of all, the reason we use property files in the first place, instead of hardcoding the properties in the code, is because we want the people who use the application to be able to change them.
Also, we usually deliver application packed as jar files (or another kind of archive, such as war, ear).
But what must the user do in order to change some properties? First of all, he must locate the property file inside the archive. Next, he must unpack the archive, change the desired properties, and pack the archive again... Seems to me a lot of trouble for the poor user! Not to mention signed jar files, where the problems are even bigger!
Just how many times did you find yourself looking through some ".jar" files looking for a "jndi.properties" file? And what if you find the file twice in the classpath? which one is loaded?

Seems to me that in this case, the user has much more trouble than just editing a good old fashioned /etc/someapp.conf file (I know, portability issues, etc.), but...

So, I think that also loading property files from classpath has some benefits, it also seems to have some drawbacks as well, which should not be disregarded.


Post Extras Print Post   Remind Me!     Notify Moderator


Entire topic
Subject Posted by Posted on
* Small inconvenience with classpath Catalin 08/18/03 09:17 AM
. * * Re: Small inconvenience with classpath vlad_roubtsov   08/18/03 02:45 PM
. * * Re: Small inconvenience with classpath Catalin   08/19/03 03:01 AM
. * * Re: Small inconvenience with classpath vlad_roubtsov   08/19/03 03:25 AM
. * * Re: Small inconvenience with classpath Anonymous   12/01/03 05:32 PM
. * * Re: Small inconvenience with classpath Anonymous   03/07/06 10:25 AM
. * * Re: Small inconvenience with classpath    12/26/06 10:54 AM

Extra information
0 registered and 3 anonymous users are browsing this forum.

Moderator:   



Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Thread views: 22050

Rate this thread

Jump to

Contact us JavaWorld

Powered by UBB.threads™ 6.5.5