数据绑定的主要示例
我正在 JavaScript 中实现一个准系统框架,它只提供对象之间的数据绑定。数据绑定可以是单向或双向的,并且可能在某个属性上绑定多个对象。有多种适用于各种语言的数据绑定解决方案,我正在努力了解最好的方案,以便从中挑选功能集。到目前为止,我已经研究了以下提供绑定的框架:
请随意编辑问题并添加支持绑定的其他框架(如果缺少)。
您认为哪些数据绑定功能在您选择的各自框架中非常有价值?该框架的目标是消除尽可能多的粘合代码。另外,有没有关于这个主题的研究论文可供我研究?
I am implementing a barebones framework in JavaScript that just provides data-binding between objects. The data-binding can either be one-way or two-way, and potentially have multiple objects bound on some property. There are several data-binding solutions available for various languages and I am trying to get a good idea of the best of all worlds to cherry pick the feature set from. So far I have researched the following frameworks that provide bindings:
Please feel free to edit the question and add additional frameworks that support binding if they are missing.
What data-binding features do you find extremely valuable in your respective framework of choice? The objective of this framework will be to eliminate as much of the glue code as humanly possible. Also, are there any research papers on the topic that I can munch on?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
还要看看其中最古老的工具包之一:Tk 工具包(通常与 tcl 相关,但也有其他语言版本)。在 Tk 中,更新 GUI 中的值通常通过简单地更新变量来完成:
或者更复杂的示例,10 秒倒计时小部件:
实际上,该功能是通过跟踪命令从 tcl 语言本身派生出来的:
当然,您可以不要期望所有语言都具有此功能。不过,您可以通过轮询来模拟它,也许可以使用 setInterval() 。 Tk 的做法对我来说感觉最自然。
Also look at one of the oldest of them all: the Tk toolkit (usually associated with tcl but is also available in other languages). In Tk updating a value in the GUI is typically done by simply updating a variable:
Or a more involved example, a 10 second countdown widget:
Actually, the feature is derived from the tcl language itself via the trace command:
Of course, you can't expect all languages to have this feature. You can sort of emulate it by polling though, using
setInterval()
perhaps. The way Tk does it feels most natural to me.