I’ve just started dabbling in google ape engine. Right now I’m using JDO with the datastore to persistent my data. Pretty cool so far and I have most everything working the way I want. However, I have a few standard practice questions. My instinct tells me there are several design choices i made that aren’t the best if not outright bad.
Do you generally have a “wrapper” type class to handle gets, updates, inserts and deletes for each persistent object?(this feels like overkill)
I don’t do any type checking on Query.execute?(this really seems wrong)
All my classes use IDGeneratoryStrategy.IDENTITY in each object which could be in a base class I guess?
As i said I just started dabbling in this as the questions above demonstrate but any input or links would be greatly appreciated. FYI my end result is to use the app engine as the datastore for android apps. However, the more I’ve see of appengine I think I can use it for more things than just storing data for my android apps.
Wrapper type : no, why should you? You use what makes sense for your application, and if something gets unwieldy you redesign it. All apps are different.
Type checking on Query.execute : JDO implementations check types of data passed in, and you could go further and use DataNucleus JDO Typesafe queries also (likely part of JDO3.2 at some point). You need v2 of the GAE JDO plugin for that
IDENTITY strategy part of a base class : inadvisable to do that … having that as the base class means that all ids of all objects are common (i.e all in same inheritance tree), and all id values come from the same source. Better to have classes structured based on role.