用于backbone.js 和 co 的宁静后端框架

发布于 2024-10-18 07:28:23 字数 329 浏览 1 评论 0原文

为了给基于 backbone.js 或者其他完整的 MVC 前端框架?

我能想到

  • 数据
    • 存储
    • 版本控制
    • 验证
    • 授权
    • (参考)完整性
  • 用户身份验证
  • 事件通知客户端

还有什么?

what's left to do for a backend framework in order to provide a restful service to a frontend application based on backbone.js or other full MVC frontend framework?

I can think of

  • data
    • storage
    • versioning
    • validation
    • authorization
    • (refential) integrity
  • user authentication
  • event notification to client

what else?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

书信已泛黄 2024-10-25 07:28:23

一些额外的事情(尽管任何事情都可能被视为您在问题中已经提到的事情的一部分):

充当中介

只要我们对 Ajax 有域限制,就有必要提供代理来启用混搭。然而,即使我们解决了这个问题,中介机构仍然会遇到其他情况。以 Twitter 的流 API 为例。 Twitter 只允许每个 API 密钥一个流,因此您的后端应用程序必须是消费者,然后将搜索结果发送给客户端。

搜索

带宽和客户端处理能力都限制了在客户端上执行搜索的程度。

作业

后台或批处理作业处理通常最好在服务器上完成。一个好的 RESTful 实践是 POST/jobs,获得一个 202 Accepted ,其中 Content-Location 标头指向到正在运行的作业。该作业的后续操作会返回状态,如果完成,还会返回结果的链接。

A few additional things (though any could probably be considered parts of things you've already mentioned in the question):

Acting as an intermediary

As long as we have domain restrictions on Ajax, it will be necessary to offer a proxy to enable mashups. Even once we fix that problem, though, there are other cases for an intermediary. Take, for example, Twitter's streaming API. Twitter only allows one stream per API key, so your backend app will have to be the consumer that then sends search results to the clients.

Search

Bandwidth and client processing capabilities both limit the degree to which search can be done on the client.

Jobs

Background or batch job processing is often best done on the server. A good RESTful practice is to POST to /jobs, get a 202 Accepted with a Content-Location header pointing to the running job. Subsequents to that job return a status and, if it's complete, a link to the results.

以酷 2024-10-25 07:28:23

迁移到前端驱动的架构时需要考虑的非常重要的一件事是,在许多情况下,您需要为搜索引擎生成内容。

因此,理想情况下,您的架构能够在服务器端路由和评估模板/视图。我认为目前非常缺乏在客户端和服务器端使用相同逻辑的能力。

看起来您几乎已经列出了所有后端任务,但是这个新架构确实为您需要如何执行这些操作提供了更多细节,因此它不一定像列表看起来那么容易。

The one thing that is very important to consider when moving to a front end powered architecture, is that in many cases you will need to generate content for search engines.

So ideally your architecture is capable of routing and evaluating templates / views on the server side. I think this ability to use the same logic on client and server side is something that is very lacking at the moment.

It looks like you pretty much have the backend tasks all listed there, but this new architecture does bring further detail into how you need to do these things, so it's not necessarily as easy as it the list makes it seem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文