知识卡片

普通读书笔记卡 · 1971.o.1.b.4.c

用户界面别虚构第二模型

理解等级:高级

界面可以简化领域模型,却不宜让用户相信一套与实现规则冲突的模型。原书以当时 IE 的“收藏夹”为例:用户以为它保存网站名称,实现却用文件名保存;名称含冒号时会报文件名错误或被悄悄改写。可选的对齐方式有两种:

  • 告知用户它实际是快捷方式文件,按文件规则操作。
  • 改变存储方式,让名称遵循网站名称的规则。

这是原书所述历史版本的案例,不代表现行浏览器行为。参见 [[模型驱动设计兼顾分析与实现]]。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    参考来源

    - 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第26章《原书第03章|Letting the Bones Show: Why Models Matter to Users》(源文件:_epub-src/0321125215_ch03lev1sec3.html) - 结论依据:原文比较用户所见的收藏夹名称与实现使用文件名的规则,并给出暴露文件模型或改变存储方式两条路径,以减少用户模型与设计模型冲突。原文明确限定为当时的 IE 版本。 - 原始内容:A user of Internet Explorer thinks of "Favorites" as a list of names of Web sites that persist from session to session. But the implementation treats a Favorite as a file containing a URL, and whose filename is put in the Favorites list. ... Alternatively, store the Favorites in a different way, say in a data file, so that they can be subject to their own rules.