I need to create some configuration files on a server that will be pulled down by a client application - the remote config file. The client application will also have its own local config file.

In the past I would have just hard coded the logic for reading/writing the config files into the program on both the the client and the server which could create a mismatch if this code is ever updated in the future. Being led in the ways of well-written, easy to maintain code by the esteemed Monks of the Monastery, I am going to write this code as a module that can be installed on both the client and the server. That way, provided both are using the same version of the module, no mismatch will be possible. The first step was to search CPAN for suitable modules. I didn't expect to find anything that fitted the task perfectly but I did find a few possible candidates of which the top choice would be Config::Simple.

I don't need blocks so want what this module calls a SIMPLIFIED INI-FILE. There are two bits of functionality missing from this module that I need:

So this gives me three options: (or are there more?)
  1. Create a module that extends Config::Simple and add the required functionality
  2. Create a module which makes use of Config::Simple
  3. Write a module from scratch
In this case I think 3 is most appropriate because Config::Simple does quite a bit of stuff that I don't want and of the the 3 things I want it to do (read/write/get), I have to write methods for 2 of them.

But this is not a one off situation...how do you decide between extending a class by including that class in @ISA or bringing the class into your class with the use statement and having your module call its methods? Some cases seem clear cut but there is a lot of middle ground where the answer is not clear to me.


In reply to To Extend, to Use, to Create by Bod

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.