Skip to content

z2019 Combine 'Clean Architecture' and 'Domain Driven Design' (in ASP.Net MVC Core)

ollin edited this page Sep 24, 2021 · 1 revision

The session was about implementing Uncle Bob's Clean Architecture as close as possible and combine it with some Domain Driven Design sugar (not that much yet). All done in a MVC web-application with server-side rendering that makes things like presenters a little cumbersome.

Starting pointers in source-code

Sample 1: Write-Usecase without a presenter but with some business-logic

Sample 2: Getting a logbook entry's detail screen using use-case interactor, output-port, output, presenter & view-model

Regarding "screaming architecture": you can quickly see the applications use-cases and therefore the applications right to exist:

Tech-Stack

I used the following tech in the session and code:

  • .Net Core 2.2 on my Mac
  • ASP.Net MVC Core 2.2
  • C# 7 (latest)
  • Jetbrains Rider IDE
  • Libraries: ** MediatR (in process message bus for requests and notifications) ** Fluent Validator (used as MediatR pipeline behaviors to validate requests) ** Unit-Testing: *** XUnit *** Fake It Easy *** Fluent Assertions *** ApprovalTest.Net

Live System(s)

The live version is fully hosted on Azure including:

  • Azure AppService (the core weg app)
  • Azure LogicApp (for triggering the email publication on a hourly base)
  • Azure Blob Storage (for storing image blobs)
  • Azure SQL Server (relational database)
  • Azure DevOps for build- and deployment automation
  • Azure Application Insights (for logging, telemetry and analytics)
  • Azure Portal Dashboards (for cost monitoring)

I have two instances of the app: stage and testing. Always intersting (at least to me) what cloud stuff really costs: the monthly bill of this app is close to CHF 15.-