“新” restfb 与“旧”脸书API
对于新的 J2EE Facebook Connect 项目,您是否推荐:
- restfb (http://www.restfb.com) ,或者:
- Facebook Java API (http://code.google.com/p/facebook-java-api)
这些要求几乎涵盖了 Facebook Connect 支持的所有内容。
完整性、易用性、稳定性等都很重要。但对我们来说最重要的是所选图书馆蓬勃发展并最终成为获胜者的可能性(如果有的话)。
谢谢。
For a new J2EE Facebook Connect project, do you recommend:
- restfb (http://www.restfb.com), or:
- Facebook Java API
(http://code.google.com/p/facebook-java-api)
The requirements cover pretty much everything supported by Facebook Connect.
Completeness, ease of use, stability, etc are important. But what matters the most to us are the odds that the selected library flourishes and ends up being the winner, if there is such at thing.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用新的基于 OAuth2 的授权流程和Graph API,SDK 所做的“工作”量已大大减少。我建议您选择一个不会尝试提供非常高级抽象的库,而是理解并利用您正在进行 HTTP API 调用的事实(例如,用于 HTTP 的并行化)要求)。我们最近发布了一个 Android SDK,虽然与您的问题无关,但可能是一个不错的选择参考点。
With the new OAuth2 based authorization flow and the Graph API, the amount of "work" an SDK does has been greatly reduced. I'd suggest that you choose a library that does not try to provide very high level abstractions, and instead understand and leverage the fact that you're making HTTP API calls (for instance, for parallelization of HTTP requests). We recently released an Android SDK which while not related to your question, may be a good point of reference.
为了充分披露,我maven RestFB 并拥有该项目的提交权。也就是说,前段时间我也处于同样的情况,需要一些 Java 库来使用 FB 的 Graph API。最初,我尝试了 facebook-java-api,但它不支持所有较新的 API。当时我深入研究了代码,发现一些固有的不灵活性使得做我需要的事情变得过于复杂,所以我四处寻找替代方案。平心而论,对 facebook-java-api 来说,也许我只是在一个糟糕的时间发现了它们(大约 6 个月前,当时只有 2.x 的小幅更新,而且当时还看不到 3.x。我看到他们已经最近发布了 3.0.2)。
不管怎样,我后来找到了 RestFB。我从一开始就喜欢它的是代码的简洁性和可扩展性,并且不需要任何额外的依赖项。基本的 Graph API 对象是内置的,创建新对象非常简单。有一两个小问题无法开箱即用,所以我提出了问题,RestFB 项目的创始人 Mark Allen 似乎对修复这些问题非常敏感,所以我坚持使用它。最近,我向该项目贡献了 Maven 构建,因为我热衷于在 Maven Central 上看到 RestFB 库,以便自己更轻松地使用它们。
For full disclosure, I mavenized RestFB and have commit rights to the project. That said, I was in the same position some time ago, needing some Java library for working with FB's Graph API. Originally, I tried out facebook-java-api, but it didn't support all the newer APIs. I peaked into the code at the time and saw some inherent inflexibility that made it overly complicated to do what I needed so I looked around for alternatives. In all fairness to facebook-java-api, perhaps I just caught them at a bad time (around 6 months ago, there were only minor updates to 2.x and no 3.x in sight at the time. I see they've released 3.0.2 recently).
Anyhow, I then found RestFB. What I liked about it from the very beginning was how clean and extensible the code was and that it didn't require any extra dependencies. The basic Graph API objects are built-in and it's very simple to create new ones. There were one or two minor things that didn't work out of the box, so I opened issues and Mark Allen, the founder of the RestFB project, seemed pretty responsive with fixing them so I stuck to using it. More recently, I contributed Maven build to the project since I was keen on seeing the RestFB libs on Maven Central to make it easier for myself to use them.