One challenge is that you are going to have more pricing models in the future, and there is no guarantee that they will conform to whatever schema or algorithm that you create today.

To ensure that tomorrow's pricing scheme fits into the schema you design today, you might need to limit the creativity of your marketing department. This is a 'bad idea', because you 'need to eat'.

Maybe what you need is a nice way to keep your code maintainable in the face of potentially wildly different requirements. Perhaps you should write new modules for the different pricing schemes, using inheritance or calling common subroutines where it makes sense.

As my friend Steve says, "Make different things different and what is the same the same." If your job is to take other people's money, the answer should be 'yes' whether the implied coding requirements violate design goals or not.

Some of the research on this topic refers to the buzz-phrase "business rules". I think the idea of encapsulating business rules into a fixed relational schema and associated algorithms is known to be problematic.

It should work perfectly the first time! - toma


In reply to Re: Database design and Class::DBI by toma
in thread Database design and Class::DBI by Ovid

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.