And what you're doing in Rose::DB, by breaking the encapsulation of DSNs is exactly analogous to that. It is unnecessary, pointless and creates work for the application programmer. Your users. The OP for instance!

I'm not breaking any encapsulation. These separate pieces of information (host, port, database name, etc.) are necessarily in the domain of the person writing the code to work with a database. It's not like these are some internal details that the DBI user doesn't need to know or concern himself with. Then the DBI user has to take these discrete pieces of information and serialize them into an obscurely formatted string, with a different format for each database. Again, the DBI user has to do this himself! DBI is not doing it for him. There is no "encapsulation" service being provided here. Only then will DBI accept this information, which it will then pass through to the DBD, which then has to deserialize it. It's completely pointless.

And again, the "pass through with no knowledge of its contents" bit that you keep going back to is completely orthogonal to the form of the data. It could just as easily be done with any other, more sensible, non-serialized data structure.

It's much easier for the user if he can deal with these pieces of information as is most natural, i.e., as separate entities, without ever having to deal with this nasty aspect of the DBI API that requires them to be serialized. What the original poster is complaining about is the exact opposite of what you claim: DBI's pointless and variable serialization of the DSN, not other module's attempts to help deal with it.

I know you think you know better, but 5 years or 10 from now, the penny will drop and you'll get it. Till then, we'd best just agree to differ, because you obviously aren't getting it now.

Right back at you.


In reply to Re^10: Avoiding compound data in software and system design by siracusa
in thread Avoiding compound data in software and system design 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.