Design Patterns Practice

This repository is designed to help you practice and master Design Patterns and SOLID principles through practical examples.

Introduction

Design patterns and SOLID principles are crucial for creating clean, maintainable, and scalable code. This repository contains various examples of code that need to be refactored, along with their refactored versions.

Project Structure

Each example folder contains:

  • original.py: The initial version of the code that needs refactoring.
  • refactored.py: The refactored version of the code.
  • README.md: A brief description of improvements made in the refactored version.

You can start with original.py and try to refactor it using design patterns and SOLID principles. Once you have completed your refactoring, you can check refactored.py.

Patterns Implemented

Below is a list of design patterns that have been used in this repository:

  • Creational Patterns
    • Factory
  • Structural Patterns
    • Adapter
  • Behavioral Patterns
    • Chain of Responsibility
    • State
    • Observer

Contributing

We welcome contributions! If you have an example you'd like to add or improvements to existing examples, please feel free to submit a pull request.