Design Patterns with reasonable code examples -i guess-. 🤓
You can check docs folder for markdown files with in depth explanations and some conditions and opportunities to use certain design pattern. 📕
Code examples for each language can be found in its separate folder that structured with what that languages conventions are with implementation of pattern and the tests.
- To understand how to implement the pattern, check the example cases, don't worry there are comments for you to understand concepts and examples better.
- To understand how the code will be used in client, check test codes.
If you have any suggestion or spotted a mistake, feel free to reach out anytime.
Builder pattern provides a flexible and organized approach to constructing complex objects.
Language | Implementation Code | Test Code |
---|---|---|
Go | Example Code | Test Code |
TypeScript | Example Code | Test Code |
The Prototype is used to create objects by cloning or copying existing objects.
Language | Implementation Code | Test Code |
---|---|---|
Go | Example Code | Test Code |
TypeScript | Example Code | Test Code |
The Singleton is used to ensure only one instance of a class is shared across whole application.
Language | Implementation Code | Test Code |
---|---|---|
Go | Example Code | Test Code |
TypeScript | Example Code | Test Code |
C# | Example Code | Test Code |
The Adapter design pattern allows objects with incompatible interfaces to work together.
Language | Implementation Code | Test Code |
---|---|---|
Go | Example Code | Test Code |
TypeScript | Example Code | Test Code |
The Observer pattern allows notifying multiple objects about an event that happened on the object they're observing.
Language | Implementation Code | Test Code |
---|---|---|
Go | Example Code | Test Code |
TypeScript | Example Code | Test Code |