I would add one field to the file - a "type". This way you can arrange the variables in a grouping and fetch the entire group - and then massage them to your hearts content.

When loading the page - you just need to grab the group and perform whatever initializations you would need to do at that time.

The admin facility would simply load the group and allow for modifications of their values.

Now, one nice this about taking this approach is that you have created a simple dynamic table - let's say in the future you need to extend a table say - customer - and add a field. Normally you would have to have the DB Admin create the field and roll in the change. Now, however, you can extend that table (type=customer) and store the field name (name=lastVisitDate) and the value (value="whatever time value you want to store"). Now, viola, you can dynamically add fields to tables until such time in the future when a DB change can actually take place. Don't forget to tag your code so that you can find which programs need to be changed in the future - if you do it with some planning up front - a simple search and replace may be all that you need!


In reply to Re: Another Opinion Request...(config file) by draconis
in thread Another Opinion Request...(config file) by powerhouse

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.