On Thu, Jan 6, 2011 at 20:26, Matthew Adams <[email protected]> wrote:
> Can you expain what you mean by this?
>
> > Among the more annoying limitations in JDO is the prohibition of
> > superclass-table inheritance.
>
> I'd like to understand it.
>
The case for a superclass-table inheritance is relevant where the app has a
series of subclasses with differing behaviors but (mostly) the same
properties. One example might be classes of display assets, such as
virtual class Asset {
Key id;
Key collection;
URI location;
virtual String displayMarkup();
}
class Image extends Asset {
String displayMarkup() {
return MarkupBuilder.generateImg(location);
}
}
class Video extends Asset {
String displayMarkup() {
return MarkupBuilder.generateObject(location);
}
}
Most persistence providers that I've used will allow the Asset class to
provide 'superclass-table' persistence which means all the Video and Image
instances persist in the Asset table. A key benefit here is that it's
efficient to retrieve all the instances of Asset that belong to a collection
(each instance will be either an Image or Video). It also makes it much
simpler to form queries, particularly since the GAE datastore doesn't allow
joins.
--
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.