Week 7 Part III · Architecture and Patterns
Instructor lesson plan: lecture (2 h) and practice (2 h).
DI containerinterfacespattern notesdesign notes
| 0:00-0:15 | 15 min | Pattern vocabularyPattern as named tradeoff, not copied ceremony. |
| 0:15-0:40 | 25 min | Repository and Unit of WorkPersistence boundary, query needs, EF Core realities, and when direct DbContext is acceptable. |
| 0:40-1:05 | 25 min | Factory and StrategyCreation rules and policy variation in business workflows. |
| 1:05-1:15 | 10 min | Break |
| 1:15-1:40 | 25 min | Adapter and DecoratorExternal services, logging, caching, validation, and cross-cutting behavior. |
| 1:40-2:00 | 20 min | Pattern selection rubricWhat problem exists, what changes independently, and what cost the pattern adds. |
Students often think: more patterns means better architecture.
Set it straight: patterns are useful only when they remove real coupling or name real variation.
| 0:00-0:25 | 25 min | Pattern diagnosisStudents inspect project code and identify two real variation points. |
| 0:25-1:00 | 35 min | Implement one patternAdd Strategy, Adapter, Factory, or Decorator with a clear usage example. |
| 1:00-1:10 | 10 min | Break |
| 1:10-1:45 | 35 min | Implement second patternAdd a second pattern and verify it does not leak into controllers. |
| 1:45-2:00 | 15 min | Project-integration briefDocument each pattern: problem, solution, tradeoff, example. |