Code examples for Patterns and Principles: Are These Important Anymore?-training.
The main aim of the training was to demonstrate how languages have evolved from the times when design patterns were often required, and to explain why and when some patterns should still be used.
Pattern examples are provided in C# and some include JavaScript implementations to show how these can be implemented using only functions. Some examples of principles are in Python.
The examples strive to utilize more real-life cases, although it is sometimes challenging to come up with a simple example.
Additionally, the examples contain UML class diagram code samples, as GoF Patterns are presented in UML.
Each C#-file includes classes and interfaces for the pattern/principle, along with tests for executing the examples.
GoF Pattern class diagrams: Design Patterns Quick Reference (MCDONALDLAND)
- Command
- Observer
- Memento
- Strategy
- State
- Iterator
- TODO
- Template Method
- Visitor
- TODO MAYBE
- Chain of Responsibility
- Interpreter
- Iterator
- Mediator
- Prototype
- Singleton
- Object Pool
- Factory / Factory Method
- Abstract Factory
- Builder
- Adapter
- Composition
- Decorator
- Proxy
- Facade
- TODO MAYBE
- Bridge
- Flyweight
These examples primarily compare functional and object-oriented patterns.
- Dependecy Injection
- Functions instead of DI
- OOP to Functions
- OOP vs FP modules
- Class vs closure
- Fluent interface / method chaining
- TODO
- Service Locator
- Repository
- Unit of work
- Liskov substitution
- Interface segregation
- TODO
- Single responsibility
- Open/Closed
- Dependency inversion
- Coupling and Cohesion
- Encapsulation and Abstraction
- Inversion of Control
- IoC Container
- TODO
- Modularity
- Command Query separation
- https://sourcemaking.com/design_patterns
- http://www.mcdonaldland.info/2007/11/28/40/
- https://github.com/Lc5/DesignPatternsCSharp
- https://github.com/abishekaditya/DesignPatterns
- https://softwareengineering.stackexchange.com/questions/178488/lsp-vs-ocp-liskov-substitution-vs-open-close
- https://softwareengineering.stackexchange.com/questions/201397/difference-between-the-adapter-pattern-and-the-proxy-pattern
- https://stackoverflow.com/questions/1658192/what-is-the-difference-between-strategy-design-pattern-and-state-design-pattern
- https://stackoverflow.com/questions/17937755/what-is-the-difference-between-a-fluent-interface-and-the-builder-pattern*