Facebook 连接 + MVC模型
我正在开发一个 ASP.NET MVC 项目,并尝试使用 facebook connect API 将其与 facebook 集成。现在,我在想象概念布局时遇到了一个小问题。我在 MVC 中使用存储库模型,我有自己的数据库。我希望能够从 FB 获取用户的信息,并且可能将他们的 fb_uid 存储在我的数据库中(这合法吗?)我还希望能够将故事发布到用户的迷你提要中。我有一个名为 User 的模型类;这个类必须填充来自我的内部数据库和 FB 数据库的数据。我有存储库类来与数据库通信,但我真的不知道哪里/哪一部分应该与 FB 通信?我想过使用 FBDeveloperToolkit,但从我在这个论坛上读到的内容来看,该工具包有点过时了!我不知道是否应该使用 XFBML 和纯 javascript 函数?如果是,如何将数据拉回我的数据库,例如用户的 fb_uid?这是否意味着我将直接从表示层调用 API 函数?
有人可以帮我吗?
谢谢!
I am working on an ASP.NET MVC project and I am trying to get it integrated with facebook by using facebook connect API. Now, I am having a small problem in imagining how the conceptual layout would be. I am using the repository model in MVC, I have my own DB. I want to be able to fetch user’s information from FB, and maybe store their fb_uid in my database (is that legal anyway?) I also want to be able to post stories into user’s mini feed. I have a model class called User; this class has to be filled with data from both my internal DB, and FB database. I have repository classes to communicate with the database, and I don’t really know where/which part should communicate with FB? I thought of using the FBDeveloperToolkit, but from what I have read in this forum, the toolkit is a bit out of date! I don’t know if I should use XFBML and pure javascript functions? And if yes, how can pull the data back to my DB, for example user’s fb_uid? And does that mean I will be directly calling the API functions from my presentation layer?
Can anyone please help me in this?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议使用 FacebookService 层来实现 Facebook API 所需的功能子集。在 DDD 世界中,它被称为反腐败层。
I would suggest a FacebookService layer that implements a subset of functionality you need from the Facebook API. In the DDD world it's called an Anti-Corruption Layer.