On Thu, Apr 1, 2010 at 1:57 AM, John Patterson <[email protected]> wrote: > > You are making a classic premature optimization mistake. > [...] > The only String value that can uniquely identify a class with no > "registration" is its fully qualified type name. I see no problem using > that kind name as a sensible default. There is nothing special about it - > its just a default that can be changed later. In fact I recommend defining > a shorter name as an optimisation to save datastore space. > If you rename your class and want to keep the same data you will need to > explicitly define the kind name for the class.
1) I vehemently disagree that fully-qualified java class names should show up in the datastore. It's one of those things that nobody notices at the beginning and then becomes cruft that is difficult to change sometime later. Ask any DBA what they think of creating tables named "com.mycompany.project.component.entity.MyEntity" - and it's *way* easier to change table names on an RDBMS than it is in GAE. 2) As you note, long kind names will significantly increase your storage requirements. Full package paths in the kind name are just a bad idea. 3) If you rename your class (or use a shorter name), you will need to register your entities ahead of time. That is, if you want polymorphic queries to work. So... you've avoided registration in the simple, un-shortened case (which you don't recommend) by storing full java package paths in the datastore. You call registration "premature optimization", I call it "planning ahead". Jeff -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" 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-java?hl=en.
