Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Database Accessor Classes

by nothingmuch (Priest)
on Mar 09, 2006 at 08:34 UTC ( [id://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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-04-23 15:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found