Is it recommended to use GAE types?

180 views Asked by At

I see that GAE provides several types like Email or PostalAddress for its entities. I've read they don't provide any validation. So I wonder: what's the benefit of using them instead of storing the data on a simple String field? Any reason I should use them?

EDIT: answered at this question

2

There are 2 answers

0
dplouffe On BEST ANSWER

Currently the only purpose for them seems to be that they seamlessly convert to gdata atom feeds which Google uses. They are probably fields that have been implemented on the framework which GoogleApps is built on and were included on the AppEngine data model. That way if you want to make an app that interacts with GoogleApps, it is that much easier.

I'm also certain that the values are "normalized" properly to be indexed. The value of the LinkProperty is most likely changed from www.stackoverflow.com to com.stackoverflow.www.

0
dfichter On

I hope Google answers this. Some guesses:

  • The Python docs talk about how these property types are represented in gdata. Can you instantiate an Email property from a gdata feed and then set it on a datastore entity? Could your app engine app (some day) provide a gdata-style web service?
  • Maybe Google has heuristics about the storage requirements of these types that help them optimize storage in the datastore.
  • Maybe they'll add functionality to these types in a later release.
  • Maybe they like typing for typing's sake.