Please note: this project is inactive since early 2006

 
4.5.10 Fetching raw rows

Sometimes and for some reasons, you do not want to get a whole set of fully initialized objects.

For example, you need to get the data for a lot of objects to do some processing on some of its attributes, but you don't need the objects per se.

Or, building a GUI, you want to present a large list of items from which the user can e.g. choose one for, say, inspection or modification; here again, you do not need all the objects to build the list, and most of times you do not want it either since this would imply a too large memory footprint (along with a fetch taking too much time): all what you want is the raw data themselves, and the ability to turn them into real objects just when you need it (e.g. for modification).

Note: Of course, when fetching raw rows, you cannot benefit from most of the framework's capabilities since it manipulates objects, not dictionaries; you shoudl also note that the fetched data are not cached by the framework. However, in some situations like the ones we saw above, it's just what you want; moreover, it speeds up the fetch process, and reduces the memory footprint to just what is needed.

In this section we'll see how to do these both things: fetching raw rows and turning a raw into a real object.


Subsections
Comments are welcome: Sebastien Bigaret / Modeling Home Page
Hosted by:SourceForge.net Logo