Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: OO Perl: classes and database access

by jeroenes (Priest)
on Sep 27, 2001 at 20:41 UTC ( #115150=note: print w/replies, xml ) Need Help??

in reply to OO Perl: classes and database access

Have you read "Code Complete" by McConnell? Read all about abstraction layers and independent components.

You have already had some suggestions about switching from database to flat file etc. Separation also holds for your user-interaction interface, whatever it is.

E.g., is clearly an interface thingy, so make it independent from your User-objects. That means: calls the user-class, and the user-class calls the database-interaction class, where holds the interface (web/CLI/GUI), user holds your (temporal) user data and the database class is left with calling whatever the database is.

You just apply this kind of reasoning to every relation you encounter while making up the program, and I think you will get around to some nice stuff pretty soon.

I'm not a real experienced OO'er or whatever, so listen to everybody else here for more advice. Browse tilly's nodes for example....


"We are not alone"(FZ)

  • Comment on Re: OO Perl: classes and database access

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://115150]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2018-06-24 23:33 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (126 votes). Check out past polls.