AppEngine RequestFactory 或“正常”方法?
这并不是一个真正的问题,更像是一个一般的 X 与 Y 问题。
所以我正在使用用谷歌应用程序引擎编写的服务器在android上尝试c2dm。目前,我正在使用“App Engine Connected Android Project”作为模板,并自己添加一些代码。因此,生成的代码使用 RequestFactory 来做很多事情,比如注册/取消注册设备、发送消息等。
我之前的后端通信经验是建立与 servlet 的连接,写入它(json)并读取响应(json)。
所以问题是: 使用 RequestFactory 与应用程序引擎通信而不是仅从 URLConnection 的输入/输出流写入/读取有什么好处(如果有)? 或者这真的只是品味问题?
This is not really a problem, more like a general X vs. Y question.
So I'm experimenting with c2dm on android using a server written in google app engine. At the moment I'm using the "App Engine Connected Android Project" as a template with some added code myself. So the generated code use RequestFactory for a bunch of stuff, like registering/unregistering devices, sending messages, etc.
My previous experiences with backend communication has existed of setting up a connection to a servlet, writing to it (json) and reading the response (json).
So here's the question:
What are the benefits (if any) with using the RequestFactory for communication with the app engine instead of just writing/reading from an URLConnection's input/outputstreams?
Or is it really just a matter of taste?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请求工厂的一个缺点是它检索对象的速度非常慢。自定义 servlet 和 http 请求要快得多(快 10 倍到 20 倍!)。
查看这篇文章了解更多详细信息RequestFactory 在 Android 上运行缓慢
One disadvantage of request factory is that it is very slow in retrieving objects.. A custom servlet and http request are MUCH faster(10x-20x faster!).
Check out this post for more details RequestFactory slow on Android
我自己还没有使用过它,但据我了解,它的主要好处是,它可以非常轻松地使用您的 Android 凭据对 App Engine 应用程序进行身份验证。手动执行此操作有点痛苦。
I haven't used it myself yet, but the main benefit, as I understand it, is that it makes it really easy to authenticate against the App Engine app with your Android credentials. Doing that by hand is a bit of a pain.