Regarding usage of configuration files

View: New views
2 Messages — Rating Filter:   Alert me  

Regarding usage of configuration files

by sreedharl :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi All, I need to take a design level decission in using configuration files and request to provide your inputs on this.

My product is having a single configuration file covering the basic configurations. While using this for a project the no of lines in this configuration file is exceeding 4000 lines.

So my collegues comming back and suggesting to have this configuration file to be splitted into mutiple.

But my concern here is that if we split the configuration files, it will be difficult in handling mutiple files and tracking on what configuration goes into which of configuration files will be very difficult

Also to my view its better to have a single configuration file as this file gets loaded only once into memory and that way increase performance when compared with using many configuration files.

Request to provide your thoughts on the same.

Thanks,
Sreedhar


Re: Regarding usage of configuration files

by dhawken :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This should not be a performance/code design question.

There should not be a performance concern with using multiple files. There is nothing precluding your properties management class(es) from being able to access multiple files - in fact, they probably should.  No matter how many files you have, they should each only be loaded into memory once per jvm.  

You could in theory still have one static class that handles all requests for properties.  It may have multiple maps inside, corresponding to the properties file organization you choose.  Whether you have multiple files or one, the code that accesses properties should know nothing about that.

On that subject of organization you choose, that is about the only decision here.  If you really feel that your properties do not easily break down into multiple modules, then perhaps go with one.  My feeling is go with multiple, although that's just for an organization and maintenance point of view.

just my thoughts