Backend line

Design Patterns

Creational, structural, behavioral patterns

7 sections

Start: Factory Pattern

Foundational 4

  1. Factory PatternCentralize creation of objects (like API handlers or executors) based on configuration or environment., not read
  2. Observer PatternThe Observer pattern lets multiple subscribers react to an event stream — price ticks, order fills, status changes — without the publisher knowing who is listening, giving you loose coupling and easy fan-out. In .NET it is typically…, not read
  3. Repository PatternMediate between the domain and the data-access layer — expose persistence as an in-memory-like collection behind an interface, so the domain never depends on EF Core, SQL, or the ORM., not read
  4. Strategy PatternEncapsulate different trading algorithms or execution strategies under a common interface., not read

Mid-level 3

  1. CQRS PatternCQRS (Command Query Responsibility Segregation) splits the write path (commands that mutate state and enforce invariants) from the read path (queries that fetch denormalized projections), so each side scales, optimizes, and secures…, not read
  2. Decorator PatternWrap existing services with additional behavior without changing them., not read
  3. Mediator PatternDefine an object that encapsulates how a set of objects interact. The mediator promotes loose coupling by keeping objects from referring to each other explicitly., not read