If your project is large and might be running for a while, you should wrap all the different calls to the database in separate functions even if you've got a nice generalized interface. You will eventually have to make some workarounds or sanity checking on the data before using them, and it's thankful to have that located one place.
I think this is why I'm leaning toward having the many function names, even if using the factored function for the basic inserts, as tadman or flounder99 suggested. This is a mod_perl application, so there's got to be some good data checks somewhere.
I also don't like the look of a bunch of calls like:
getByFieldval("sometable", "somecolumn",$value1);
all over the place. I have trouble remembering the table names and column names... Shouldn't various layers of the application be somewhat insulated from one another? Data encapsulation and all that... :)
-
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.
|