Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: OO Application Design

by spartacus9 (Beadle)
on Sep 25, 2002 at 04:24 UTC ( [id://200557]=note: print w/replies, xml ) Need Help??


in reply to OO Application Design

I have always gone with the class method version, i.e., $person->getAdults(); This way seems to require less code upfront. Typically I put all of the class methods that are generic (including the actual DBI connection handle) into a single Package file and use that file from the perl program. That way once you get all your class methods written, you don't have to touch them again while your're messing with the perl program that uses them.

That said, if you have a huge amount of data returned by the calls to your class methods, it may be better to create a separate class that only knows about, in this case, people. That could be used to reduce the amount of data you fetch when you only need a certain small portion of the data.

Replies are listed 'Best First'.
Re: Re: OO Application Design
by Ryszard (Priest) on Sep 25, 2002 at 08:17 UTC
    I used to use this approach, however now have abstracted my dbi stuff into a seperate object.

    One place to make maintaince changes now - not 20 like before..

Log In?
Username:
Password:

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

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

    No recent polls found