pureMVC:界面中每个选项卡的唯一中介
我正在构建一个选项卡式界面,用于在各种相似的层之间进行切换。每一层都会有许多图表。通过用鼠标拖动,可以重新排列图形,甚至可以在层之间移动图形。我的问题是,最好的做法是为每一层注册一个唯一的中介来跟踪各层内容/组织,还是应该用一个中央中介来跟踪所有内容。
一些注意事项:
图层内容和组织将被保存(在数据库中),以便当用户返回应用程序时可以恢复它。
这些层本身在功能上是相同的。
用户可以随意添加和删除图层。
谢谢!
I am building a tabbed interface for switching between various similar layers. Each layer will have a number of graphs. By dragging with the mouse the graphs can be rearranged or even moved between layers. My question is, is it best practice to register a unique mediator for each layer that keeps track of the layers content / organization, or should i keep track of it all with one central mediator.
some considerations:
the layer contents and organization will be saved(in a db) so that it can be restored when a user comes back to the app.
the layers themselves are functionally identical.
the user can add and remove layers at will.
thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于这种用途,我通常会通过向中介器的构造函数传递唯一标识符来单独中介选项卡式界面中的每个屏幕。这些层不需要不同的中介器类,只需要具有易于检索的唯一名称的不同中介器实例。我通常会覆盖 getMediatorName 并返回 NAME + uniqueId。
For this sort of use I will generally mediate each screen in a tabbed interface individually by passing in a unique identifier with the constructor of the mediator. The layers won't require different mediator classes, just different mediator instances with unique names that are easy to retrieve. I typically override getMediatorName and return NAME + uniqueId.