Skip to content

ArpadGBondor/Design-pattern-tutorial-projects

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The videos are not belong to me. I just wanted to create the example projects myself, to understand design patterns better.

Sources:

Wikipedia

Design pattern tutorial videos by Avish Links to the blog, are under the videos.

Design pattern tutorial videos by Michael

Design pattern tutorial videos by Scott Lilly

Content

Design patterns

  • A pattern is a way to describe a tested, proven solution or approach to a common design problem within a given context in software design.

1. Creational patterns

  • These patterns deal with object creation mechanisms, trying to create in a manner suitable to the situation.
  • The basic form of object creation could result in design problems or added complexity to the design.

1.1. Builder

1.2. Factory

1.3. Prototype

1.4. Singleton

2. Structural patterns

  • These patterns ease the design by identifying a simple way to realise relationships between entities.

2.1 Adapter/Translator

  • Convert the interface of a class into another interface clients expect. An adapter lets classes work together that could not otherwise because of incompatible interfaces. The enterprise integration pattern equivalent is the translator.
  • Video: Michael - The Adapter Pattern

2.2. Bridge

  • Decouple an abstraction from its implementation allowing the two to vary independently.

2.3. Composite

  • Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly.
  • Video: Michael - The Composite Pattern

2.4. Composition over Inheritance / Composite reuse principle

2.5. Decorator

2.6. Facade/Wrapper

2.7. Flyweight

  • Use sharing to support large numbers of similar objects efficiently.

2.8. Proxy

  • Provide a surrogate or placeholder for another object to control access to it.

3. Behaviour patterns

  • These patterns identify common communication patterns between objects and realize these patterns. By doing so, these patterns increase flexibility in carrying out this communication.

3.1. Chain of responsibility

  • Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request. Chain the receiving objects and pass the request along the chain until an object handles it.

3.2. Command

3.3. Interpreter

  • Given a language, define a representation for its grammar along with an interpreter that uses the representation to interpret sentences in the language.

3.4. Iterator

  • Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation.
  • Video: Michael - The Iterator Pattern

3.5. Mediator

  • Define an object that encapsulates how a set of objects interact. Mediator promotes loose coupling by keeping objects from referring to each other explicitly, and it allows their interaction to vary independently.

3.6. Memento

3.7. Null object

3.8. Observer or Publish/Subscribe

3.9. State

  • Allow an object to alter its behavior when its internal state changes. The object will appear to change its class

3.10. Strategy

3.11. Template method

  • Define the skeleton of an algorithm in an operation, deferring some steps to subclasses. Template method lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure.
  • Video: Michael - The Template Method Pattern

3.12. Visitor

  • Represent an operation to be performed on the elements of an object structure. Visitor lets a new operation be defined without changing the classes of the elements on which it operates.

4. Concurrency patterns

  • These type of design patterns deal with the multi-threaded programming paradigm.

4.1. Active object

4.2. Balking

4.3. Barrier

4.4. Binding properties

4.5. Double-checked locking

4.6. Event-based asynchronous method invocation (AMI)

4.7. Guarded suspension

4.8. Join

4.9. Lock

4.10. Monitor

4.11. Proactor

4.12. Reactor

4.13. Read/Write lock

4.14. Scheulder

4.15. Thread pool

4.16. Thread-local pool

5. Architectural patterns

  • An architectural pattern is a concept that solves and delineates some essential cohesive elements of a software architecture. Countless different architectures may implement the same pattern and share the related characteristics.

5.1. Front controller

5.2. Interceptor

5.3. MVC

5.4. MVVM / Model-view-viewmodel

5.5. n-tier

5.6. Specification

5.7. Naked objects

5.8. Service locator

5.9. Active record

  • The active record pattern is an approach to accessing data in a database. A database table or view is wrapped into a class. Thus, an object instance is tied to a single row in the table. After creation of an object, a new row is added to the table upon save. Any object loaded gets it's information from the database. When an object is updated, the corresponding row in the table is also updated. The wrapper class implements accessor methods or properties for each column in the table or view
  • Wiki
  • Video: Scott Lilly - C# Design Patterns: The Data Mapper pattern and the Active Record pattern

5.10. Identity map

5.11. Data access object

5.12. Date mapper

  • A data mapper is a Data Access Layer that performs bidirectional transfer of data between a persistent data store (often a relational database) and an in-memory data representation (the domain layer). The goal of the pattern is to keep the in-memory representation and the persistent data store independent of each other, and the data mapper itself. The layer is composed of one or more mappers (or data access objects) performing the data transfer.
  • Wiki
  • Video: Scott Lilly - C# Design Patterns: The Data Mapper pattern and the Active Record pattern

5.13. Data transfer object

5.14. Dependency Injection / Inversion of control

  • Dependency injection is a technique whereby one object supplies the dependencies of another object. A dependency is an object that can be used (a service). An injection is the passing of a dependency to a dependent object (a client) that would use it. The service is made part of the client's state. Passing the service to the client, rather than allowing a client to build or find the service, is the fundamental requirement of the pattern.
  • The intent behind dependency injection is to decouple objects to the extent that no client code has to be changed simply because an object it depends on needs to be changed to a different one.
  • Wiki
  • Video: Scott Lilly - C# Design Patterns: The Dependency Injection Pattern

About

C# design pattern tutorial projects

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages