Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
The way we handle this in the shop I work for is to have a global, sitewide configuration that's split up into logical segments based upon what each part of the configuration is for.

When writing new stuff, we have a Config module set up that allows configuration segments to be loaded independently of one another, in the combinations that we usually use them in (for convenience) or all at once (for when you can't find the bit of the config database that you need *grin*).

By abstracting out the configuration layer, we ensured that the new code (and any old code) has no knowledge of what the data looks like on disk (it's actually XML at the minute): it simply gets served up a configuration hash from the config layer. If something about the file's structure needs to change, or even we move from a flat file to some other storage method, the change impacts only the config layer - no other code needs to be modified.

As far as "how much is too much" goes, I'm a big fan of reusable, configurable code, but not at the expense of readability and ease of maintenence. The time to stop adding configuration variables is when the code becomes less clear by using them, or becomes harder to maintain owing to the need to track down a load of configuration data, often split over a number of files, simply to see what a section of code's doing.


In reply to Re: Toolset configuration by Tanalis
in thread Toolset configuration by mrhenroi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-03-29 00:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found