简体   繁体   English

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

[英]What design patterns are used in diagramming tools?

Diagram.net is good diagramming tool. Diagram.net是一个很好的图表工具。

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 ;). 注意/注意:我这样做是因为有趣,所以请不要指导我使用现有的工具(我可能会投票...只是孩子;)。

From the "Gang of Four" (GOF) "Design Patterns" book: 来自“四人帮”(GOF)“设计模式”一书:

  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. 还有一个名为“Product Trader”的PLOP模式可以帮助对反序列化保存的文件(例如图表文件) - 以便将它们加载回内存。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM