Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Hacking with objects

by fmogavero (Monk)
on Mar 26, 2001 at 21:11 UTC ( [id://67239]=note: print w/replies, xml ) Need Help??


in reply to Hacking with objects

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://67239]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-04-24 13:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found