Java is a strongly typed language for good reason - it makes it harder
to make mistakes. You should only use extension if your data model
"is a" HashMap - probably never. For example, a Product data model is
not a HashMap.
You are describing building a type-safe wrapper to the datastore.
Several well used libraries already exist to do this: Twig, Objectify,
SimpleDB, Slim3. Perhaps one of those would suit you needs.
On 23 May 2010, at 21:20, Julio Faerman wrote:
I really like the fast, schema-less datastore, and i would like to
have that on my model objects.
So, instead of using POJOs for Model/TO, i am using HashMaps.
I have extended HashMap adding key and parent properties to have a
one-
to-one mapping with Entity.
Using this approach, i gain:
- Schema-less objects
- Fast, reflection-less persistence (may i add hassle-less?)
- Still OO (Inheritance, polymorphism and encapsulation), i just have
to write different acessors
getXxx (){ return get("Xxx") }
- GWT compatibility (no cglib, persistent collections, etc)
I am now accounting the negative side of the tradeoff. What do you
think?
Best Regards,
Julio
--
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
.
--
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.