Skip to content

A simple project for show to you samples of the implementation of Design Patterns using C#

License

Notifications You must be signed in to change notification settings

fabioalmeida100/design-patterns-samples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Design patterns samples

Last update

  • 2023-05-18 - Added the Behavioral folder with the Chain of Responsibility pattern. Pending: add all UML diagrams and README for explain the samples.

About this repo

This repository contains samples of design patterns in C#. Use for learning purposes.

What is a design pattern?

A design pattern is a general, reusable solution to a commonly occurring problem within a given context in software design.

It is a description or template for how to solve a problem that can be used in many different situations.

By using a pattern, you can avoid reinventing the wheel every time you run into a common problem and communication better the solution with your team.

There are three types of design patterns:

  • Creational patterns: these patterns are all about class instantiation.
  • Structural patterns: these patterns are about organizing different classes and objects to form larger structures and provide new functionality.
  • Behavioral patterns: these patterns are all about class's objects communication. Behavioral patterns are those patterns that are most specifically concerned with communication between objects.

How to use this repo

Each pattern is in a separate folder. The folder contains a README.md file with a description of the pattern and a sample of the pattern in C#.

  • The creational patterns are in the Creational folder.
  • The structural patterns are in the Structural folder.
  • The behavioral patterns are in the Behavioral folder.

Open the solution in Visual Studio 2022 and run the specific project that you want understand.

Tips for learning design patterns

All concepts about desing pattern is about the main techniques and principles of object-oriented design. If you want to learn design patterns, you need to know the following concepts:

  • Abstraction: the process of hiding the internal details and showing only the functionality.
  • Encapsulation: the process of binding together the data and the functions that manipulate them.
  • Inheritance: the process of creating new classes from existing classes.
  • Polymorphism: the ability of an object to take on many forms.

SOLID principles are also important to learn design patterns, because some patterns are based on these principles.


By https://www.fabiodeveloper.com - Every person is unique! Enjoy it :-) - MIT license - 2023

About

A simple project for show to you samples of the implementation of Design Patterns using C#

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages