Skip to content

This repository provides an in-depth exploration of Design Patterns in C# and .NET, using the latest C# features and modern programming methodologies like dependency injection and reactive programming. It covers all Gang of Four (GoF) design patterns, offering practical insights and modern variations for contemporary development.

License

Notifications You must be signed in to change notification settings

SalehAhmadi/design-patterns-csharp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Design Patterns in C#

Overview

This repository offers an in-depth exploration of Design Patterns in C# and .NET. It includes:

  • Utilization of the latest C# and .NET framework versions
  • Adoption of contemporary programming methodologies such as dependency injection and reactive programming
  • Use of modern development tools like ReSharper
  • Examination of pattern variations and alternative methods
  • It thoroughly covers all the Gang of Four (GoF) design patterns as detailed in their influential book, alongside modern adaptations, refinements, and intrinsic usage within the language.

Prerequisites

  • Strong proficiency in C#
  • Familiarity with the latest C# features
  • In-depth understanding of object-oriented design principles

Patterns Covered

This repository includes comprehensive coverage of all Gang of Four (GoF) design patterns, encompassing creational, structural, and behavioral patterns. Additionally, it delves into SOLID design principles, ensuring a well-rounded understanding of both fundamental and advanced design concepts in C#. Each pattern is explored with practical examples and modern variations. The full list includes:

  • SOLID Design Principles
    • Single Responsibility Principle
    • Open-Closed Principle
    • Liskov Substitution Principle
    • Interface Segregation Principle
    • Dependency Inversion Principle
  • Creational Design Patterns
    • Builder
    • Factories (Factory Method and Abstract Factory)
    • Prototype
    • Singleton
  • Structural Design Patterns
    • Adapter
    • Bridge
    • Composite
    • Decorator
    • Façade
    • Flyweight
    • Proxy
  • Behavioral Design Patterns
    • Chain of Responsibility
    • Command
    • Interpreter
    • Iterator
    • Mediator
    • Memento
    • Null Object
    • Observer
    • State
    • Strategy
    • Template Method
    • Visitor

Target Audience

This repository is tailored for .NET/C# developers aiming to go beyond basic examples and understand the various adaptations and techniques for implementing design patterns in modern development.

File Format and Usage

Since all examples are consolidated in this repository and the files are in .txt format, you can easily convert them back to the original .cs files by simply removing the .txt extension. This allows you to run and modify the code directly in your preferred C# development environment. The repository emphasizes code over UML class diagrams, utilizing tools such as Visual Studio, various NuGet packages, the ReSharper unit test runner, and dotMemoryUnit.

Contributing

First off, thanks for taking the time to contribute! Contributions are what makes the open-source community such an amazing place to learn, inspire, and create. Any contributions you make will benefit everybody else and are greatly appreciated.

Please try to create bug reports that are:

  • Reproducible. Include steps to reproduce the problem.
  • Specific. Include as much detail as possible: which version, what environment, etc.
  • Unique. Do not duplicate existing opened issues.
  • Scoped to a Single Bug. One bug per report.

Please adhere to this project's code of conduct.

You can use markdownlint-cli to check for common markdown style inconsistency.

Code of Conduct

Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Support

Reach out to the maintainer at:

License

This project is licensed under the MIT license. Feel free to edit and distribute this template as you like.

See LICENSE for more information.

About

This repository provides an in-depth exploration of Design Patterns in C# and .NET, using the latest C# features and modern programming methodologies like dependency injection and reactive programming. It covers all Gang of Four (GoF) design patterns, offering practical insights and modern variations for contemporary development.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published