"new" restfb vs. "old" Facebook API
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开发者_StackOverflow中文版.
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.
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.
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.
精彩评论