Plant UML Design Patterns

PlantUML code for some Design Patterns. The syntax can be looked up on PlantUML's class diagram documentation.

Example

Code Diagram
Abstract factory code Abstract factory diagram

Included patterns

Creational Structural Behavioral
Abstract factory Adapter Chain of Responsibility
Builder Bridge Command
Factory method Composite Interpreter
Prototype Decorator Iterator
Singleton Facade Mediator
  Flyweight Memento
  Proxy Observer
    State
    Strategy
    Template method
    Visitor

Running

If you do not intend to run locally, please have a look at the alternatives found in this overview.

Prerequisites

To run locally, the PlantUML jar (from PlantUML's download site) is needed. As described on the Getting started site, you will also need both Java and Graphviz installed on your machine.

Creating the diagrams

The easiest way is to just run the included python script (run.py). It checks for changes in the diagram files and only generates the new/changed ones. The PlantUML jar should be in the same directory.

python run.py

The generated diagrams are stored in the output folder.

To run PlantUML directly from the command line for one specific diagram, you can execute:

java -jar plantuml.jar diagram.txt

Built With

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Acknowledgments

  • The pattern descriptions and overall class diagram arrangements are taken from a cheat sheet from Jason Mcdonalds blog