Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Re: Object Oriented Pattern help

by DrZaius (Monk)
on May 13, 2001 at 02:28 UTC ( [id://79973]=note: print w/replies, xml ) Need Help??


in reply to Re: Object Oriented Pattern help
in thread Object Oriented Pattern help

You probably don't want your objects creating the dbh handles for you. This doesn't scale and is not portable; you have to edit your perl modules if you change your database or use on a different server.

What if you already have the database connection open in your code? Do you want your objects to open a new connection per object?

But creating a $self->{dbh} is probably a good idea. I would do something like:

my $person = People->new(dbh => $dbh, %other_data);

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-19 17:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found