ttu / patterns-and-principles

Code examples for Patterns and Principles - are these important anymore? training

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

C# Patterns & Principles

Code examples for Patterns and Principles: Are These Important Anymore?-training.

The main aim of the training was to demonstrate how languages have evolved from the times when design patterns were often required, and to explain why and when some patterns should still be used.

Pattern examples are provided in C# and some include JavaScript implementations to show how these can be implemented using only functions. Some examples of principles are in Python.

The examples strive to utilize more real-life cases, although it is sometimes challenging to come up with a simple example.

Additionally, the examples contain UML class diagram code samples, as GoF Patterns are presented in UML.

Each C#-file includes classes and interfaces for the pattern/principle, along with tests for executing the examples.

Patterns

Gang of Four

GoF Pattern class diagrams: Design Patterns Quick Reference (MCDONALDLAND)

Behavioral

Creational

  • Prototype
  • Singleton
  • Object Pool
  • Factory / Factory Method
  • Abstract Factory
  • Builder

Structural

  • Adapter
  • Composition
  • Decorator
  • Proxy
  • Facade
  • TODO MAYBE
    • Bridge
    • Flyweight

Other

These examples primarily compare functional and object-oriented patterns.

  • Dependecy Injection
  • Functions instead of DI
  • OOP to Functions
  • OOP vs FP modules
  • Class vs closure
  • Fluent interface / method chaining
  • TODO
    • Service Locator
    • Repository
    • Unit of work

Principles

SOLID Principles

  • Liskov substitution
  • Interface segregation
  • TODO
    • Single responsibility
    • Open/Closed
    • Dependency inversion

Other

  • Coupling and Cohesion
  • Encapsulation and Abstraction
  • Inversion of Control
  • IoC Container
  • TODO
    • Modularity
    • Command Query separation

Links

Differences

About

Code examples for Patterns and Principles - are these important anymore? training

License:MIT License


Languages

Language:C# 83.7%Language:Python 9.9%Language:JavaScript 6.5%