A collection of D design patterns/idioms (inspired by python-patterns)
Working D compiler is required, check out download page on dlang.org.
You can run examples with rdmd
tool, dub or build them manually.
$ rdmd example.d
dub is a build tool and package manager for the D programming language. Every example in this repository is a single-file dub package.
$ dub example.d
Use one of:
$ dmd example.d # for DMD compiler
$ gdc example.d # for GDC
$ ldc2 example.d # for LDC
This will compile and link example
program:
$ ./example
Pattern | Description |
---|---|
Command | bundle a command and arguments to call later |
Strategy | selectable operations over the same data |
Pattern | Description |
---|---|
Strategy | selectable operations over the same data |
Pattern | Description |
---|---|
Decorator | wrap functionality with other functionality in order to affect outputs |
Facade | use one class as an API to a number of others |