Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I have to agree that this is really not as tragic as you make it out to be. There are severe tradeoffs between the use of intermediate objects designed for inter-package compatibility (DBI, and Rose::DB::Object), and the use of simple serialized strings.

I think the example of 'open' is particularly instructive as a counterargument to your critique. Try opening a file in Java. You first have to create a Buffer object around a Reader object which wraps a File object. You will write this code millions of times in your lifetime, and you will always wonder why, especially if you use languages like perl, ruby, or python which allow you to just open a string path.

Getting the different parts of the DBI connect string is not nearly as energetically expensive as getting the chocolate back out of chocolate milk. Nor is it too much work for people who use both DBI and Rose::DB::Object to store their connect strings as serialized YAML, JSON, etc. to be used by code to construct the arguments suitable for the context that they are to be used in. Now, if it is the case that there are more than 10 people out there that wish there was a compatibility layer on DBI that allowed it to take the same arguments as Rose::DB::Object (and there may very well be, so speak up if you are reading this), they should decide which of them wants to get involved with the DBI codebase to provide this functionality. It would probably not be that hard to override DBI connect to take the same connect params as Rose::DB::Object, nor would it be hard to create a separate CPAN module that can take a central hash argument (such as might be retrieved from a YAML, JSON, etc. serialized configuration file), and provide methods to construct dbi_connect_string, or rose_db_object_connect_params, etc.


In reply to Re: Avoiding compound data in software and system design by dmlond
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-04-24 06:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found