What is a good practice for application initialization files. I’ll be using xml files for my initialization files, but I don’t just want to cram everything in one file. How should I split up the files? Should it be by class? by module?
Thanks, let me know if you need more information.
Think of how a user or developer would like to interact with these files, back them up, version them (SVN, CVS, etc) and/or transport configuration from one machine/installation to another. Usually it’s best to keep all your configuration in a single file. You’d need a good reason not to do this.
I’ve had good reasons in the past, but usually for very specialised in-house applications where machine-specific configuration (related to local hardware) needed to be separated from application-specific configuration. The separation meant I could update the application config and roll it out to all our machines without fear of overwriting the hardware config.
Generally, I’m a fan of a well-structured, well-documented and intuitively organised single configuration file. If it gets large, big deal — that’s what scrollbars and search utilities were designed for! Down the track, when you’re hunting for a particular setting, it’s going to bug the hell out of you if you have to search for it in 10 different files.