views:

93

answers:

1

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 ;).

+2  A: 

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.

Brent Arias