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

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.

zz zZ Z Z #!perl

Comment on Re: Database Accessor Classes

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2015-11-30 00:29 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (754 votes), past polls