Skip to content

zxbe/CSharpDesignPatterns

 
 

Repository files navigation

CSharpDesignPatterns

A Repository to practice and demonstrate proficiency with design patterns in C#

How to use

  • Set a breakpoint at the first line of the program file for the design pattern to study and step into the program using f11. Make sure you have it set as the startup project by right clicking the program file. Have both the structural file and real world file open, along with the program file and the UML diagram. I've marked the most common design patterns below. Open up a new practice class and rewrite the patterns until you can produce them from memory, starting with the most common.

Frequency of use

Creational Patterns

  • (5 of 5)Abstract Factory - Creates an instance of several families of classes
  • (5 of 5)Factory Method - Creates an instance of several derived classes
  • (4 of 5)Singleton - A class of which only a single instance can exist
  • (3 of 5)Prototype - A fully initialized instance to be copied or cloned
  • (2 of 5)Builder - Separates object construction from its representation

Structural Patterns

  • (5 of 5)Facade - A single class that represents an entire subsystem
  • (4 of 5)Adapter - Match interfaces of different classes
  • (4 of 5)Composite - A tree structure of simple and composite objects
  • (4 of 5)Proxy - An object representing another object
  • (3 of 5)Bridge - Separates an object's interface from its implementation
  • (3 of 5)Decorator - Add responsibilities to objects dynamically
  • (1 of 5)Flyweight - A fine-grained instance used for efficient sharing

Behavioral Patterns

  • (5 of 5)Iterator - Sequentially access the elements of a collection
  • (5 of 5)Observer - A way of notifying change to a number of classes
  • (4 of 5)Command - Encapsulate a command request as an object
  • (4 of 5)Strategy - Encapsulates an algorithm inside a class
  • (3 of 5)State - Alter an object's behavior when its state changes
  • (3 of 5)Template Method - Defer the exact steps of an algorithm to a subclass
  • (2 of 5)Chain of Responsibility - A way of passing a request between a chain of objects
  • (2 of 5)Mediator - Defines simplified communication between classes
  • (1 of 5)Interpreter - A way to include language elements in a program
  • (1 of 5)Memento - Capture and restore an object's internal state
  • (1 of 5)Visitor - Defines a new operation to a class without change

About

A Repository to practice and demonstrate proficiency with design patterns in C#

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%