├── .formatter.exs ├── .gitignore ├── README.md ├── behavioral ├── chain │ ├── README.md │ └── run.exs ├── command │ ├── README.md │ ├── commands.exs │ ├── run.exs │ ├── run.sh │ └── runner.exs ├── interpreter │ ├── README.md │ └── run.exs ├── iterator │ ├── README.md │ └── run.exs ├── mediator │ ├── README.md │ └── run.exs ├── memento │ ├── README.md │ └── run.exs ├── observer │ ├── README.md │ ├── employee.exs │ ├── hr.exs │ ├── payroll.exs │ ├── run.exs │ └── tax_man.exs ├── state │ ├── README.md │ └── run.exs ├── strategy │ ├── README.md │ ├── formatter.exs │ ├── html_formatter.exs │ ├── plain_text_formatter.exs │ ├── report.exs │ ├── run.exs │ └── using_fn │ │ ├── README.md │ │ ├── report.exs │ │ └── run.exs ├── template_method │ ├── README.md │ ├── html_report.exs │ ├── plain_text_report.exs │ ├── report.exs │ └── run.exs └── visitor │ ├── README.md │ └── run.exs ├── creational ├── builder │ ├── README.md │ ├── builder.exs │ ├── computer.exs │ ├── run.exs │ └── run.sh ├── factory │ ├── README.md │ ├── graphics.exs │ ├── run.exs │ ├── run.sh │ └── shape_factory.exs ├── factory_method │ ├── README.md │ └── run.exs ├── prototype │ ├── README.md │ └── run.exs └── singleton │ ├── README.md │ └── run.exs └── structural ├── adapter ├── README.md └── run.exs ├── bridge ├── README.md └── run.exs ├── composite ├── README.md ├── cooking.exs ├── run.exs └── run.sh ├── decorator ├── README.md └── run.exs ├── delegation ├── README.md └── run.exs ├── facade ├── README.md ├── run.exs └── run.sh ├── flyweight ├── README.md └── run.exs └── proxy ├── README.md └── run.exs /.formatter.exs: -------------------------------------------------------------------------------- 1 | [ 2 | inputs: ["**/*.{ex,exs}"] 3 | ] 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/README.md -------------------------------------------------------------------------------- /behavioral/chain/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/chain/README.md -------------------------------------------------------------------------------- /behavioral/chain/run.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/chain/run.exs -------------------------------------------------------------------------------- /behavioral/command/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/command/README.md -------------------------------------------------------------------------------- /behavioral/command/commands.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/command/commands.exs -------------------------------------------------------------------------------- /behavioral/command/run.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/command/run.exs -------------------------------------------------------------------------------- /behavioral/command/run.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/command/run.sh -------------------------------------------------------------------------------- /behavioral/command/runner.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/command/runner.exs -------------------------------------------------------------------------------- /behavioral/interpreter/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/interpreter/README.md -------------------------------------------------------------------------------- /behavioral/interpreter/run.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/interpreter/run.exs -------------------------------------------------------------------------------- /behavioral/iterator/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/iterator/README.md -------------------------------------------------------------------------------- /behavioral/iterator/run.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/iterator/run.exs -------------------------------------------------------------------------------- /behavioral/mediator/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/mediator/README.md -------------------------------------------------------------------------------- /behavioral/mediator/run.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/mediator/run.exs -------------------------------------------------------------------------------- /behavioral/memento/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/memento/README.md -------------------------------------------------------------------------------- /behavioral/memento/run.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/memento/run.exs -------------------------------------------------------------------------------- /behavioral/observer/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/observer/README.md -------------------------------------------------------------------------------- /behavioral/observer/employee.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/observer/employee.exs -------------------------------------------------------------------------------- /behavioral/observer/hr.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/observer/hr.exs -------------------------------------------------------------------------------- /behavioral/observer/payroll.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/observer/payroll.exs -------------------------------------------------------------------------------- /behavioral/observer/run.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/observer/run.exs -------------------------------------------------------------------------------- /behavioral/observer/tax_man.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/observer/tax_man.exs -------------------------------------------------------------------------------- /behavioral/state/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/state/README.md -------------------------------------------------------------------------------- /behavioral/state/run.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/state/run.exs -------------------------------------------------------------------------------- /behavioral/strategy/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/strategy/README.md -------------------------------------------------------------------------------- /behavioral/strategy/formatter.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/strategy/formatter.exs -------------------------------------------------------------------------------- /behavioral/strategy/html_formatter.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/strategy/html_formatter.exs -------------------------------------------------------------------------------- /behavioral/strategy/plain_text_formatter.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/strategy/plain_text_formatter.exs -------------------------------------------------------------------------------- /behavioral/strategy/report.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/strategy/report.exs -------------------------------------------------------------------------------- /behavioral/strategy/run.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/strategy/run.exs -------------------------------------------------------------------------------- /behavioral/strategy/using_fn/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/strategy/using_fn/README.md -------------------------------------------------------------------------------- /behavioral/strategy/using_fn/report.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/strategy/using_fn/report.exs -------------------------------------------------------------------------------- /behavioral/strategy/using_fn/run.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/strategy/using_fn/run.exs -------------------------------------------------------------------------------- /behavioral/template_method/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/template_method/README.md -------------------------------------------------------------------------------- /behavioral/template_method/html_report.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/template_method/html_report.exs -------------------------------------------------------------------------------- /behavioral/template_method/plain_text_report.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/template_method/plain_text_report.exs -------------------------------------------------------------------------------- /behavioral/template_method/report.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/template_method/report.exs -------------------------------------------------------------------------------- /behavioral/template_method/run.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/template_method/run.exs -------------------------------------------------------------------------------- /behavioral/visitor/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/visitor/README.md -------------------------------------------------------------------------------- /behavioral/visitor/run.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/behavioral/visitor/run.exs -------------------------------------------------------------------------------- /creational/builder/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/creational/builder/README.md -------------------------------------------------------------------------------- /creational/builder/builder.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/creational/builder/builder.exs -------------------------------------------------------------------------------- /creational/builder/computer.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/creational/builder/computer.exs -------------------------------------------------------------------------------- /creational/builder/run.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/creational/builder/run.exs -------------------------------------------------------------------------------- /creational/builder/run.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/creational/builder/run.sh -------------------------------------------------------------------------------- /creational/factory/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/creational/factory/README.md -------------------------------------------------------------------------------- /creational/factory/graphics.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/creational/factory/graphics.exs -------------------------------------------------------------------------------- /creational/factory/run.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/creational/factory/run.exs -------------------------------------------------------------------------------- /creational/factory/run.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/creational/factory/run.sh -------------------------------------------------------------------------------- /creational/factory/shape_factory.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/creational/factory/shape_factory.exs -------------------------------------------------------------------------------- /creational/factory_method/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/creational/factory_method/README.md -------------------------------------------------------------------------------- /creational/factory_method/run.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/creational/factory_method/run.exs -------------------------------------------------------------------------------- /creational/prototype/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/creational/prototype/README.md -------------------------------------------------------------------------------- /creational/prototype/run.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/creational/prototype/run.exs -------------------------------------------------------------------------------- /creational/singleton/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/creational/singleton/README.md -------------------------------------------------------------------------------- /creational/singleton/run.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/creational/singleton/run.exs -------------------------------------------------------------------------------- /structural/adapter/README.md: -------------------------------------------------------------------------------- 1 | # Usage 2 | 3 | ``` 4 | elixir run.exs 5 | ``` -------------------------------------------------------------------------------- /structural/adapter/run.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/structural/adapter/run.exs -------------------------------------------------------------------------------- /structural/bridge/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/structural/bridge/README.md -------------------------------------------------------------------------------- /structural/bridge/run.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/structural/bridge/run.exs -------------------------------------------------------------------------------- /structural/composite/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/structural/composite/README.md -------------------------------------------------------------------------------- /structural/composite/cooking.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/structural/composite/cooking.exs -------------------------------------------------------------------------------- /structural/composite/run.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/structural/composite/run.exs -------------------------------------------------------------------------------- /structural/composite/run.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/structural/composite/run.sh -------------------------------------------------------------------------------- /structural/decorator/README.md: -------------------------------------------------------------------------------- 1 | # Usage 2 | 3 | ``` 4 | $ elixir run.exs 5 | ``` -------------------------------------------------------------------------------- /structural/decorator/run.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/structural/decorator/run.exs -------------------------------------------------------------------------------- /structural/delegation/README.md: -------------------------------------------------------------------------------- 1 | # Usage 2 | 3 | ``` 4 | $ elixir run.exs 5 | ``` -------------------------------------------------------------------------------- /structural/delegation/run.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/structural/delegation/run.exs -------------------------------------------------------------------------------- /structural/facade/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/structural/facade/README.md -------------------------------------------------------------------------------- /structural/facade/run.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/structural/facade/run.exs -------------------------------------------------------------------------------- /structural/facade/run.sh: -------------------------------------------------------------------------------- 1 | elixir run.exs 2 | -------------------------------------------------------------------------------- /structural/flyweight/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/structural/flyweight/README.md -------------------------------------------------------------------------------- /structural/flyweight/run.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/structural/flyweight/run.exs -------------------------------------------------------------------------------- /structural/proxy/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/structural/proxy/README.md -------------------------------------------------------------------------------- /structural/proxy/run.exs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZXZs/elixir-design-patterns/HEAD/structural/proxy/run.exs --------------------------------------------------------------------------------