图表工具中使用哪些设计模式?

发布于 2024-08-29 16:09:17 字数 342 浏览 1 评论 0原文

Diagram.net 是很好的图表工具。

我需要了解这个工具使用了哪些设计模式,以便我能够理解它是如何工作的。

  1. 该工具使用了哪些设计模式?
  2. 图表工具通常使用哪些设计模式?

我还想知道如何使用它来开发非常简单的图表工具(只有矩形节点和直链接)。

注意/警告:我这样做是为了好玩,所以请不要引导我使用现有的工具(我可能会否决投票..只是开玩笑;)。

Diagram.net is good diagramming tool.

I need to understand what design patterns are used by this tool so that I can understand how it works.

  1. What design patterns are used in this tool?
  2. What design patterns are generally used for diagramming tools?

I would also like to know how can I use this to develop very simple diagramming tool (Only rectangular nodes and straight links).

NOTE/Caution: I am doing this for FUN so please don't direct me to existing tools(I might down vote.. just kiddin ;).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

似最初 2024-09-05 16:09:17

来自“四人帮”(GOF)“设计模式”一书:

  1. 备忘录:用于“撤消”操作
  2. 原型:简化图解对象的创建(同时促进组合而不是继承)

还有一种称为“产品交易者”的 PLOP 模式这有助于反序列化保存的文件(例如图表文件) - 以便它们可以加载回内存。

当然,还有其他适用于任何类型 UI 的模式,例如“责任链”(GOF),但这些模式通常是由您正在开发的 UI 框架“提供”给您的。

From the "Gang of Four" (GOF) "Design Patterns" book:

  1. Memento: for "undo" operations
  2. Prototype: to simplify the creation of diagrammatic objects (while promoting composition over inheritance)

There was also a PLOP pattern called "Product Trader" which can be helpful for deserializing saved files (such as diagram files) - so that they can be loaded back into memory.

Of course there are other patterns that apply to any kind of UI, such as "Chain of Responsibility" (GOF), but those are usually "provided" to you by the UI framework that you are developing with.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文