Enterprise Software Engineering with C# and .NET: Architecture, Design Patterns, and AI-Enabled Systems · HIT

Week 7   Part III · Architecture and Patterns

Enterprise Design Patterns I

Instructor lesson plan: lecture (2 h) and practice (2 h).

Learning objectives

Tools this week

DI containerinterfacespattern notesdesign notes

🎓Lecture · 2 hours

0:00-0:1515 minPattern vocabularyPattern as named tradeoff, not copied ceremony.
0:15-0:4025 minRepository and Unit of WorkPersistence boundary, query needs, EF Core realities, and when direct DbContext is acceptable.
0:40-1:0525 minFactory and StrategyCreation rules and policy variation in business workflows.
1:05-1:1510 minBreak
1:15-1:4025 minAdapter and DecoratorExternal services, logging, caching, validation, and cross-cutting behavior.
1:40-2:0020 minPattern selection rubricWhat problem exists, what changes independently, and what cost the pattern adds.
Common misconception to confront.

Students often think: more patterns means better architecture.
Set it straight: patterns are useful only when they remove real coupling or name real variation.

Check for understanding
When is Strategy useful?
When a family of algorithms or policies varies independently from the workflow that uses it.
What is Adapter protecting?
The application from the shape, instability, or vendor-specific contract of an external dependency.
Key takeaways.

📚Reading & resources

💻Practice · 2 hours

0:00-0:2525 minPattern diagnosisStudents inspect project code and identify two real variation points.
0:25-1:0035 minImplement one patternAdd Strategy, Adapter, Factory, or Decorator with a clear usage example.
1:00-1:1010 minBreak
1:10-1:4535 minImplement second patternAdd a second pattern and verify it does not leak into controllers.
1:45-2:0015 minProject-integration briefDocument each pattern: problem, solution, tradeoff, example.

Project integration (this week)

PreviousWeek 6: Layered ArchitectureNextWeek 8: Midterm Presentations and Clean Architecture