Hi,
I'm trying to come up with techniques and best-practices regarding the location of configuration files, and by that I mean two different kinds: spring context XML files, and Java .properties files that contain environment-specific data, such as the server addresses and passwords.
With regards to environment-specific properties, my main concern is that if these files are bundled in the WAR file, then each installation overrides the local copies, which most likely have been modified (in fact, in some cases, it doesn't even make any sense that the application will come with defaults, for example, database URL). Spring's PropertyPlaceholderConfigurer looks for the files somewhere in the classpath, or anywhere in the file-system. My question is, where is it best to put them? somewhere under the web-server, or someplace else entirely? Do people write their own propertyConfigurer implementations that load properties via other mechanisms?
With regards to Spring context files: so far I used to place them either at the root of my source folder (so they're in the root of my classpath at deployment), or under WEB-INF if it's a web-application. However, in many cases I find it better to break large context files in to smaller ones, grouped by topic (e.g. web-tier, data-access tier, acegi etc). Is it a good idea to put them with their respective classes, that is, with the source-code, in the respective package? or would it make it harder to manage, since we end up with dozens of XMLs all over the place?
I'd be happy to hear what other people are doing.
Thanks,
Naaman


Reply With Quote
