GUI要求的最终一致性? [英] GUI recommandations for eventual consistency?

查看:122
本文介绍了GUI要求的最终一致性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用分布式和可伸缩体系结构时,通常需要最终的一致性.

When using distributed and scalable architecture, eventual consistency is often a requirement.

从图形上讲,如何处理这种最终的一致性?

Graphically, how to deal with this eventual consistency?

用户习惯于单击保存",并立即查看结果...最终不可能保持一致.

Users are used to click save, and see the result instantaneously... with eventual consistency it's not possible.

在这种情况下如何处理GUI?

How to deal with the GUI for such scenarios?

请注意,该问题适用于桌面应用程序和Web应用程序.

Please note the question applies both for desktop applications and web applications.

PS:我正在使用Microsoft平台,但是我想这个问题适用于任何技术...

PS: I'm working with the Microsoft platform, but I imagine the question applies to any technology...

推荐答案

A 任务基于UI的非常适合此模型.您可以从UI创建和执行任务.您还可以使用任务状态监视器之类的工具在执行任务时向用户显示.

A Task Based UI fits this model great. You create and execute tasks from the UI. You can also have something like a task status monitor to show the user when a task has executed.

另一种选择是从客户端使用某种类型的池.您发送命令,并从客户端进行缓冲,直到命令完成并且新数据可用为止.在某些情况下,从用户按下保存到看到新记录的时间会有延迟,但是在大多数情况下,它几乎应该是同步的.

Another option is to use some kind of pooling from the client. You send the command, and pool from the client until the command completed and the new data is available. You will have a delay in some cases from when the user presses save to when he will see the new record, but in most cases it should be almost synchronous.

另一个(好的?)选项是承担/设计不会失败的命令.这并非易事,但是您可以在客户端上具有缓存,甚至可以在命令执行之前将命令中的数据添加到该缓存中并显示给用户.如果命令在某些意外情况下失败,那么只需设计一个好的我们很抱歉"消息,以使用户误导几秒钟.

Another (good?) option is to assume/design commands that don't fail. This is not trivial but you can have a cache on the client and add the data from the command to that cache and display it to the user even before the command has been executed. If the command fails for some unexpected situation, well then just design a good "we are sorry" message for misleading the user for a few seconds.

您也可以结合上面的方法.

You can also combine the methods above.

通常,最终的一致性更多是业务/域问题,您应该让域专家来处理.

Usually eventual consistency is more of a business/domain problem, and you should have your domain experts handle it.

这篇关于GUI要求的最终一致性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆