I typically think in objects when I develop my systems. As a result, I spend more than 99% of my time creating classes from where I instantiate objects.
I do have a similar problem as yours, since I constantly ask myself when I should bring out a class from my application source file and make it a separate module file.
When I write a new class for the first time, I try to think if I can make it generic so that it could be reused by a future application and more often than just often this is the case.
If I don't immediately see the usage for the class in another application, I tend to keep the class in the original application's source file. At the first occurence of reuse, I have a very small effort to cut out the class and put it in it's own module file.
There is a small disadvantage with a module file; Distribution and installation. Especially to remote systems and when you have different systems for development, integration test and production. (Which is my case.)
On the other hand, if the class/module can be reused in more than one application, the reuse related advantages almost immediately outweights the distribution and logistics costs/efforts.
Everything went worng, just as foreseen.
-
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.
|