Design Patterns for Loosely Coupled Applications
summary
Argues that loose coupling cuts maintenance costs and shows a concrete C#/.NET Core refactor: a one-file console app reading a month-file becomes separate layers using a repository pattern for file I/O, a strategy pattern for catering rules, and .NET Core ServiceCollection for dependency injection. Demo code is on GitHub in incremental branches; the read repository, strategy and orchestration are implemented and enable isolated unit tests and mocking; the write/save repository is left as the exercise, proving the approach works for swapping data sources.
AI-written summary · about
chapters (35)
- 0:00Introduction
- 1:55LiquidNone
- 2:36Arizona GiveCamp
- 3:15Loose coupling
- 3:31Why loose coupling
- 4:24Loosely coupled vs tightly coupled
- 5:32Solid principles
- 5:54Outline
- 6:22Single Responsibility Principle
- 7:35Dependency inversion
- 8:04Canonical example
- 8:52Classic example
- 10:10CSharp example
- 15:09Design patterns
- 15:52Facade pattern
- 17:06Read and write repositories
- 17:43Sample methods
- 18:53Changing databases
- 20:33Defining capabilities
- 21:19Defining abstractions
- 22:53Repositories
- 24:06dependency injection
- 24:39frameworks
- 25:00wire up dependencies
- 25:46dependency bag
- 26:37querying
- 28:54mixed logic
- 30:37strategy pattern
- 32:01interface
- 32:31separate strategies
- 33:14demo
- 36:33what have we done
- 38:00resources
- 38:47QA
- 44:13Interfaces
related talks
57mClean architecture with ASP.NET Core
01h 02mPatterns for application development with ASP.NET Core
01h 01mLet’s talk patterns
59mClean Architecture With ASP.NET Core
36mApplication Architecture Patterns
41mAchieving Loose Coupling with Pure Dependency Injection
59mRefactoring to Patterns with ReSharper
01h 01mASP.NET Basics for Experts
