4

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

Pratik Deoghare
  • 35,497
  • 30
  • 100
  • 146
  • Are you asking about the design patterns used when writing Diagram.net itself? Design patterns are not used according to the type of thing you are writing, but rather according to common problems that need solving. This is why your point 2 above doesn't make a lot of sense. – Slavo Apr 20 '10 at 08:32
  • 1
    Diagramming isn't that easy. It probably uses *all* of them. Don't judge a book by its cover. – Hans Passant Apr 20 '10 at 10:35
  • @Slavo, it makes sense to me. he was trying to write a simple diagramming tool, and wanted to see how others have done it who have gone before him. As a matter of fact, the GoF book uses a diagramming framework as one of its examples, but of course you knew that. – toddmo Mar 09 '15 at 21:44

1 Answers1

3

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
  • 29,277
  • 40
  • 133
  • 234