SproutCore 的“绑定”是否有效?功能让小部件发起对服务器的调用以获取数据?
我的团队的任务是快速评估 SproutCore 和其他几个替代方案。确实没有足够的时间进行深入研究,但我们的发现可能会让我们说服当局允许进行更深入的研究。 (现在,我们只是快速浏览一下“那里有什么”)。
所以我和一位队友开始研究 SproutCore。到目前为止我很喜欢它,但他已经决定他不喜欢它。他不喜欢它的原因是他的印象是 Todos 教程中的“数据绑定”是 Visual Studio 网格控件可能执行的简单数据绑定......其中允许小部件本身访问互联网到服务器并在需要绘制自身时获取新数据。
如果是这样的话我会感到震惊,因为这是一种非常幼稚的方法,实际上只适用于演示软件,而 SproutCore 对我来说比这要优雅得多。
不幸的是,我们可能没有时间让我们任何一个人去确定答案。 那么,使用过 SproutCore 并且熟悉它的人能否解释一下 Bindings 是如何工作的,以及是否允许 Bindings 向服务器发起 Ajax 调用以获取更多数据?
UPDATE:我得到了我需要的答案,部分来自谷歌小组,部分来自更深入的挖掘。绑定正是我所想的......一个伟大工具,用于连接 Javascript 环境中内存中的对象。它们消除了大量的“粘合代码”,并且像 SproutCore 的其余部分一样,做得非常好。它绝不是“原始数据绑定”。 SproutCore 是一个功能强大、优雅的库,我希望有很多机会使用它 (尽管我当前的项目,唉,选择了其他东西)。
My team is tasked with quickly evaluating SproutCore and a couple of other alternatives. There's not really enough time for a deep dive, but our findings might let us convince the powers that be to allow for a deeper dive. (Right now, we're just taking a quick glance to see "what's out there").
So me and a teammate have started looking at SproutCore. I'm loving it so far, but he has already decided he doesn't like it. The reason he doesn't like it is he got the impression that the "data binding" in the Todos tutorial is the naive kind of data binding that a Visual Studio grid control might do ... where the widget itself is allowed to reach across the Internet to the server and obtain new data whenever it needs to paint itself.
I would be shocked if that were the case, because it is such a naive approach that really is only good for demo-ware, and SproutCore feels much more elegant than that to me.
Unfortunately, we're probably not going to have time for either one of us to find out for sure. So, can someone who has used SproutCore and knows it well please explain a bit about how Bindings work, and whether or not Bindings are allowed to initiate an Ajax call to the server to obtain more data?
UPDATE: I got the answers I need, partly from the google group and partly from digging deeper. The Bindings are exactly what I thought they were ... a great tool for connecting objects in memory inside the Javascript environment. They eliminate a TON of "glue code", and, like the rest of SproutCore, are REALLY well done. In no way is it anything close to "naive data binding". SproutCore is one powerful, elegant library, and I hope to get plenty of chances to use it (though my current project, alas, chose to go with something else).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不认为我有资格“很好地了解 [SproutCore]”,但我不认为您的问题实际上是关于绑定本身的;这是关于允许轮询服务器获取数据的内容。我的印象是,绑定主要在应用程序内部相互通信。绑定可以更改(本地)Store 中的数据,但我认为 Store 不一定在每次更改时都会启动 Ajax 调用。
预计到达时间:这项工作正在进行中重申,“使用了绑定用于对象间通信。”
I don't think I qualify as "knowing [SproutCore] well," but I don't think your question is really about bindings per se; it's about what's allowed to poll the server for data. It's my impression that bindings largely talk to each other inside the application. A binding can change data in the (local) Store, but I don't think the Store necessarily initiates an Ajax call every time it's changed.
ETA: This work in progress reiterates, "Bindings are used for inter-object communication."