2

我正在尝试开发一个客户端-服务器分布式系统。客户端将在 iOS 中运行,而我想使用 java 作为后端部分。

我想写一些 API,因为我在移动环境中,我无法预测有多少客户会询问我的服务,你建议什么样的 BaaS?

不需要保持与 TCP 的开放连接,我想避免无用的电池浪费。我需要使用 SSL 进行一些 API 调用并使用 HTTP 1.1 层,而不是 TCP 会帮助我很多。我想使用 JSON 作为输出。

我可以使用现成的框架(java-iOS)来实现这个目标,或者你可以建议的库吗?您将如何设置所有内容以便在 iOS 端拥有心跳机制(这样我就可以跟踪所有客户端服务器端)并适当地回答。服务器端什么是最合适的 JBoss 或 Glassfish?我听说过反应器模式,有什么可以从java开始的吗?

我真的很感谢你!

问候

4

1 回答 1

2

It is quite easy to implement a RESTful API in java. There is a specification for that - jax-rs. There are several libraries that implement it - Jersey is the reference implementation, but there are others as well. For server - I would go for Tomcat or Jetty. Unless you use EJBs (which I don't think you really want to), there is no reason to use an application server like Glassfish or JBoss.

于 2013-04-19T18:45:48.210 回答