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

Week 6   Part III · Architecture and Patterns

Layered Architecture and Application Structure

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

Learning objectives

Tools this week

solution foldersproject referencesdependency rulesC4 diagrams

🎓Lecture · 2 hours

0:00-0:1515 minProposal feedback synthesisCommon scope and boundary issues from week 5.
0:15-0:4025 minThe four common layers
  • Presentation, application, domain, infrastructure.
  • Responsibilities and examples in the semester project.
0:40-1:0525 minDependency direction
  • Who may reference whom, and why.
  • Keeping infrastructure replaceable.
1:05-1:1510 minDTOs, commands, and servicesApplication input and output models versus API models.
1:15-1:2510 minBreak
1:25-1:5025 minC4 diagramsSystem context, containers, and component diagrams for student systems.
1:50-2:0010 minPractice previewRestructure the project without breaking behavior.
Common misconception to confront.

Students often think: layers are just folders.
Set it straight: layers are dependency and responsibility rules. Folders without rules do not create architecture.

Check for understanding
Why should domain not reference infrastructure?
The domain should express business rules without depending on databases, HTTP clients, files, or framework details.
Where does a use case usually live?
In the application layer, coordinating domain behavior, persistence abstractions, validation, and output models.
Key takeaways.

📚Reading & resources

💻Practice · 2 hours

0:00-0:2020 minDependency mapDraw current project references and identify violations.
0:20-0:5535 minRestructure solutionMove code into presentation, application, domain, and infrastructure projects.
0:55-1:1015 minCompile and inspectFix reference direction and keep behavior intact.
1:10-1:2010 minBreak
1:20-1:5030 minDiagram updateCreate a C4 container or component sketch for the new structure.
1:50-2:0010 minProject-integration briefSubmit the revised structure and diagram.

Project integration (this week)

PreviousWeek 5: Proposal and EF CoreNextWeek 7: Enterprise Design Patterns I