in reply to Re^3: Application-wide configuration
in thread Application-wide configuration
I have two applications, each of them uses a database. Database name and other credentials are stated in separate configuration files. So, each of their configuration files contains a parameter named 'database'.
If I later want to reuse ORM classes from both applications in a new application, I will not be able to do this if they use the same Config::Once class. (I will necessarily have several configuration files too, of course). That's what I meant by 'reusability'.
This is probably ugly, but such thing happen.
There may also be problems with separate web applications running under mod_perl (won't they share the same perl process and the same Config::Once, too?), though I may be mistaken.
So I think simply using Config::Once everywhere is slightly easier, but may turn out to be a problem in some corner cases. Subclassing is a better practice.
This is not very different from, say, common practice using Rose::DB.
|
|---|