Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Database Accessor Classes

by nothingmuch (Priest)
on Mar 09, 2006 at 08:34 UTC ( #535345=note: print w/ replies, xml ) Need Help??


in reply to Database Accessor Classes

Most object relational mapper thingamabobs allow you to specify which fields are loaded in the begining, and which fields are lazily fetched.

The basic idea is that the user class is asked for an object with id $whatever, and then that class uses the ORM goodness to, at the very least, check if that id matches the primary key fields of the table it's mapping. In this query it will also fetch all the fields which it has been told to, and can even pre-fetch relationships (Class::DBI doesn't support this, but DBIx::Class does).

Whenever you ask the object for not-yet-ready field it will make another SQL statement, and fetch that field as well.

-nuffin
zz zZ Z Z #!perl


Comment on Re: Database Accessor Classes

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2015-05-07 07:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    In my home, the TV remote control is ...









    Results (157 votes), past polls