~/talk

Implementing the Clean Architecture in .NET Core

Talkat NDC Oslo 2018 · 2018-06-11..06-15· [frontend-architecture]
slides:none on file

Shows a working .NET Core Web API refactor: code moves out of controllers into facade layers, then into command/query interactors (use cases) implemented with a dispatcher pipeline so cross‑cutting concerns like retry and logging become attributes. Uses Brighter (CQRS/command dispatcher), Docker and a REST client for demos. Demonstrates dependency inversion via ports (interfaces) and adapter registrations at the composition root, keeps tests passing after refactor, and proves adapters can be swapped without changing core application code.

AI-written summary · about

  1. 0:00Start
  2. 5:20The Clean Architecture Book
  3. 6:38Boundaries Controllers and Entities
  4. 17:44Coupling
  5. 18:28Direct Dependency Style Coupling
  6. 21:11Cohesion
  7. 22:43Layering
  8. 22:55Three Layer Model
  9. 23:40Infrastructure Layer
  10. 27:20Types of Business Logic Domain Logic
  11. 28:31Service Layer Provides Application Logic
  12. 28:59Rules Engines
  13. 30:50Operation Script Approach
  14. 35:19Restclient
  15. 36:47Adapter Layer
  16. 43:54This Is a More Form Wallet Presentation I Pulled Off the Internet Somewhere of Someone Doing a Use Case those Circles Essentially Represent Use Cases and Someone's Going To Look at What a Business Processes in a Restaurant and Said What Are the Key Use Cases That We Have To Do So Let's Say I Wanted To Basically You Know Automate and Give the Server a Handheld so They Could Essentially Do All the Interaction with the Customer and a Handheld these Were the Kind of Use Cases I'D Start To Look at and the Use Case Essentially Says What Are the Steps That I Have To Complete
  17. 48:57So What Are the Advantages of a Hexagonal Architecture Is We Can Begin To Write Our Tests Cleanly against this Control Boundary because those Are the Used Cases in the System We Want To Test and So You Write Your Unit Tests against that Control Layer Not against the Boundary Layer and if You Need To Then Essentially You Can Write some Integration Test To Confirm You'Ve Hooked Up Your Boundary Layer Correctly Otherwise You Rely on System Tests To Prove Everything Works End To End because I Just Proved When I Switched between My Different Layers Then Essentially that Still Works My It's My Test Still Worked Even though I Began To Move Stuff down the Layering
  18. 52:46And It's Hard To Reuse I Have To Reuse the Whole Facade Even if I Only Want One Operation but It Turns Out that Model Is Really Just Commands So the Command Pattern Essentially Says I Want To Encapsulate the Idea of Calling the Domain Part of in some Kind of Transactional Boundary and There's a Strong Alignment Then between this Idea of a Command Model and a Use Case so I Can Turn those Individual Fusaro Items into Commands so I'M Just Implementing an Interface on Command Which Is Basically a Standard Interface Essentially
  19. 55:37We Can See I Have some Attributes on There and those Attributes Are Handling Orthogonal Items Such as Retry Logic Try and Talk to Database It Fail Just Retry Maybe It's a Temporary Error Maybe It's a Deadlock You Are Trying To Basically It Felt a Lot that Way Seems To Be Down Break the Circuit Don't Make Calls on Here Anymore Give the User a Too Many Requests and Get Them To Slow Down Okay I Want To Log this so that Port Layer that Interactive Layer Is Also a Very Useful Layer for Us To Intercept
  20. 58:46And of Course I Don't Get to Detail in this Slide but that Leads to the Idea of Cqrs this Separation between the Query Side Objects and the Command Side Objects Okay this Talk Is Not about Ctrs so that's the Details Slide I Understand that but the Goal Is Reached To Hint to You Little To Go down that Route and Then We Also Took a Command Dispatcher Which Is this an Idea or Effectively That I Can Separate the Parameters of the Command from the Execution Body so that I Can Insert Operations between Essentially the Point I Call in the Boundary
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.