Welcome to the Design Patterns Examples repository! This repository serves as a personal project to document and showcase my understanding of design patterns through practical implementations in multiple programming languages. Each implementation is organized by language and categorized by the type of design pattern, offering a clear and structured reference.
Language | Coverage Badge |
---|---|
Java | |
TypeScript | |
Python |
design-patterns/
├── typescript/ # Design patterns implemented in TypeScript
├── java/ # Design patterns implemented in Java
├── python/ # Design patterns implemented in Python
├── rust/ # Design patterns implemented in Rust
├── go/ # Design patterns implemented in Go
└── README.md # Root README file
Each language folder contains examples categorized into the following types:
- Creational Patterns: Focused on object creation mechanisms.
- Structural Patterns: Deal with object composition and relationships.
- Behavioral Patterns: Concerned with object interaction and responsibilities.
The project will be implemented step by step, with additional features like containerization and testing examples added along the way.
- TypeScript
- Implement creational, structural, and behavioral patterns.
- Include comments and clear explanations.
- Java
- Translate TypeScript implementations into Java.
- Highlight Java's object-oriented features.
- Python
- Implement patterns in Python.
- Leverage the dynamic nature of the language.
- Rust
- Implement patterns in Rust.
- Focus on ownership, borrowing, and concurrency.
- Go
- Implement patterns in Go.
- Highlight simplicity and concurrency features.
- Testing Examples
- Provide test cases for each design pattern in all languages.
- Use language-appropriate testing frameworks.
- Dockerization
- Dockerize the project to provide a unified environment for running the examples.
- Include a
Dockerfile
anddocker-compose.yml
to facilitate usage.
- Singleton
- Factory Method
- Abstract Factory
- Builder
- Prototype
- Adapter
- Composite
- Proxy
- Decorator
- Facade
- Bridge
- Observer
- Strategy
- Command
- State
- Mediator
- Chain of Responsibility
Ensure you have the necessary tools installed for the language you wish to explore:
- TypeScript: Node.js
- Java: JDK 8+ and a Java build tool like Maven or Gradle
- Python: Python 3.8+
- Rust: Rustup or Cargo
- Go: Go 1.18+
- Docker: Docker Desktop or equivalent for your system
This repository is intended to:
- Document Knowledge: Provide a structured and practical way to record and showcase my understanding of design patterns.
- Offer a Reference: Serve as a resource for revisiting and reinforcing the principles of software architecture.
- Highlight Cross-Language Implementation: Demonstrate the application of design patterns in multiple programming languages.
- Ensure Portability: Dockerize the project to enable seamless execution across environments.
- Improve Reliability: Include testing examples to validate implementations.
Thank you for exploring this repository! Feel free to use it as a learning resource or reference for implementing design patterns. 🎉