Uml Ascii Art Examples

last modified: October 29, 2004

These examples are here to illustrate how UML diagrams can be done in UmlAsciiArt, when Wiki pages need them. Before trying your own, check out the UmlAsciiArtTips.

Contributors: DavidPrice,


Composite design pattern structure (from DesignPatterns)

+--------+   +-------------------+ *
| Client |------>| Component         |<------------------------+
+--------+       +-------------------+                         |
                  | Operation()       |                         |
                  | Add(Component)    |                         |
                  | Remove(Component) |                         |
                  | GetChild(int)     |                         |
                  +--------+----------+                         |
                          .                                    |
                         /_\                                   |
                          |                                    |
                +---------+------------+                       |
                 |                      |                       |
          +------+------+       +---------+---------+  children |
          | Leaf        |       | Composite         |<>---------+
          +-------------+       +-------------------+
          | Operation() |       | Operation()       |
          +-------------+       | Add(Component)    |
                                | Remove(Component) |
                                | GetChild(int)     |
                                +-------------------+

Singleton design pattern structure (from DesignPatterns)

+-----------------------+
| Singleton              |
+-----------------------+
| _Instance()_           |
| SingletonOperation()  |
| GetSingletonData()     |
+-----------------------+
| _uniqueInstance_       |
| singletonData  |
+-----------------------+

(This is boring, but is included to illustrate underlining for static items).


AbstractFactory design pattern structure (from DesignPatterns). This is really stretching the UmlAsciiArt idea to its limits...

+-------------------+                                                +--------+
| AbstractFactory() |<--------------------------------------------| Client |
+-------------------+                                             +----+---+
| CreateProductA()  |                  +------------------+           |
| CreateProductB()  |                  | AbstractProductA |<---------+
+---------+---------+                   +---------+--------+    |
        .                                         .              |
        /_\                                     /_\             |
        |                                         |              |
        |                                       +------+------+   |
+------------+------------+                     |               |         |
|                        |              +-----+-----+ +-----+-----+     |
|                        |              :">| ProductA2 | | ProductA1 |<": |
|                        |              :  +-----------+ +-----------+  : |
 +---------+--------+   +---------+--------+    :                               : |
 | ConcreteFactory1 |"""  | ConcreteFactory2 |""""":    +------------------+    : |
 +------------------+  :  +------------------+  :       | AbstractProductB |<-------+
 | CreateProductA() |  :  | CreateProductA() |  :       +---------+--------+    :
 | CreateProductB() |  :  | CreateProductB() |  :               .               :
 +------------------+  :  +------------------+  :               /_\             :
:                               |               :
:                           +------+------+     :
:                           |           |       :
                           :  +-----+-----+ +-----+-----+  :
                        "">| ProductB2 | | ProductB1 |<":
                        +-----------+ +-----------+  :
                                                        :
                   """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

Minimalist version (what are all the boxes buying you?):

Conversation
converse();
        |
        I
        |
          +----------+---------+
          |                     |
        Real_Conversation       Mock_Conversation
        converse();       converse();
        |
        |
        v
        Socket

I think TabMunging busted some of these.


Loading...