On Sun, Nov 29, 2009 at 9:00 PM, Rodrigo Moraes <[email protected]> wrote: > On Sat, Nov 28, 2009 at 10:09 PM, MajorProgamming wrote: >> I was wondering: isn't using reference properties a waste of space? >> Wouldn't it make more sense to store the id (assuming not using >> key_name) of the entity. After all, if the Kind is known, one can >> easily generate the full key based on that. And with a reference >> property it actually stores the _entire_ key (very long!). > > > Storing the key or the full path is the only way to retrieve *any* > entity. Why? Because you can't generate a full key for an entity that > has ancestors using only a key name or id. You need the full path of > ancestor entities. The key is the full path encoded. > > For simple and common cases (entity with no ancestor), you can surely > store simply the id or key name. But you have to keep in mind that > this won't work for any possible entity (if you store an entity with > ancestor, you can't retrieve it back). > > -- rodrigo > Ancestor pattern I avoid til either understood or forced there. Same with keys, the less machinegenerated and more natural, intrinsic and geniune identificators, the better. Welcomed proven wrong or supported since still learning. Nick Rosencrantz
-- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
