其他框架中的 GWT 事件总线概念
我不知道市场上有很多框架,但我想知道一些事情,比如 GWT 中的事件总线概念,这种技术是否存在于其他框架中?
I am not aware of the many frameworks on the market but i wanted to know something, Like the event bus concept in GWT, does this technique exist in other framework??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
许多 UI 框架使用 EventBus 模型。事件只是异步消息。 UI 框架通常使用这些异步机制进行通知,因为它们不希望在系统处理对 UI 所做的最后更改时阻止用户与系统交互。有时人们使用观察者模式自己编写这些总线,有时框架提供它们。
事件和事件总线在其他异步系统中具有相似之处。例如,面向消息的中间件(例如JMS服务器)是一种跨进程或跨系统的机制,其概念上与EventBus相同。
Many UI frameworks use an EventBus model. Events are just asynchronous messages. UI frameworks usually use these asynchronous mechanisms for notifications because they don't want to block the user from interacting with the system while it is processing the last change they made to the UI. Sometimes people write these busses themselves using the Observer Pattern, and sometimes the frameworks provide them.
Events and event buses have parallels in other asynchronous systems. For example, message oriented middleware (e.g. a JMS server) is a cross-process or cross-system mechanism that is conceptually the same thing as a EventBus.
EventBus - 此 API 似乎实现了您正在寻找的内容。
EventBus - This API seems to implement what you're looking for.
我认为Event Bus是解耦发送者和接收者,你可以看看设计模式中的监听器模式。
I think Event Bus is to decouple the sender and receiver, you may take a look for Listener Pattern in Design Pattern.