I upvoted this node because, in the main, I think you make an excellent point about the positive value of redundancy. However, I think when you apply this argument to generalized data conversion, you are setting up a straw man.

I've built and designed systems with intentional redundancy, usually for reasons of security and auditing, just as you discussed above. However, the redundancy is in the data, not the code that processes it. Perhaps we just read the OP differently, but I think OP was bothered by the redundancy in the template code, not the redundancy in the data it produced.

Whether in templates or Perl code, there is a lot of coding redundancy when you navigate complex data structures to produce custom per-object dump routines for N different formats. Redundant code attracts bugs like honey does bees. Even if you fix a bug in one place, you still have to go out and find all the places where that bug is repeated. This search process is highly prone to human error.

Looking at the specific example you gave (Person-everything) I would argue that lack of redundancy was not the problem, but rather a mismatch between the design and the code/architecture used to process the data. If you are going to fracture objects among multiple tables, you also need to insure that you have a proper mechanism for reassembling the objects and applying security based on view/Person "subclass". Furthermore the mechanism needs to be implemented via stored procedures, triggers and restricted views of the data. Robust transaction support is also essential.

If your database does not support such a mechanism and you can't write an extension to the DBMS that does support it, then you are guarenteed to have security problems someday, somewhere. You have no choice but to implement the reassembly and security mechanism outside of the DBMS and your security is totally dependent on the good behavior of the applications that access the database.

Best, beth


In reply to Re^2: polymorphic data-driven rendering? by ELISHEVA
in thread polymorphic data-driven rendering? by metaperl

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.