开发者

Using GUID as key name in AppEngine

I'm implementing an iPhone application that syncs data with an AppEngine backend. I'm using this method to implement the syncing:

How to Sync iPhone Core Data with web server, and then push to other devices?

To be able to create objects offline on the phone I've decided to use GUID as primary key in the iPhone app. And when开发者_如何学C I receive new objects from the server they must then relate to each other with GUID, for example object A reference object B by having a GUID reference. To make it easier to create the json data for each object (A) that references another object (B) with ReferenceProperty, I'm thinking about having the GUID as key name so I can get the GUID from the ReferenceProperty/Key without having to fetch the referenced object (B) each time I want to serialize object (A).

Is using a GUID as key name on all objects a good way to solve this?


Yes, if you want to eager assign a random, unique ID, GUID key names are a good fit.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜