IMHO Objects are the way to go if you have the time.

I came to my current employer and suggested objects. There is already Perl code that will do everything I want, here. The fallacy as I see it in the current work situation is that people keep re-inventing the wheel. They take that one liner and change it to what they need it for. There's nothing wrong with that until you see two people doing the same task different ways.

This is what is happening at work. I was tasked with combining all of the different methods people use and create one method for the task. I initially thought that I could write a Q&D (Quick & Dirty) script to solve the problem. I decided against that when I realized that through object orientation I could take almost all the tasks around here and standardize them.

Here is how I approached it. Our business is based on information contained in a database. We do two things: we either put information into the database, or we take information out. That is it on the simplest level. Taking the information out is always the same. It's putting the information in that causes a lot of headaches because of the different formats of information.

My solution is to create an object that contains the information, an object that connects to the database, an object that loads the information to the database, an object that extracts the object from the database, an information destination object and an information origin object.

Thus the loading and extracting tasks could be standardized with flexibility to change any portion of the process.


In reply to Re: Hacking with objects by fmogavero
in thread Hacking with objects by frankus

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.