Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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., login.pl is clearly an interface thingy, so make it independent from your User-objects. That means: login.pl calls the user-class, and the user-class calls the database-interaction class, where login.pl 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....

Cheers,

Jeroen
"We are not alone"(FZ)


Comment on Re: OO Perl: classes and database access

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2014-12-27 01:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls