In this module we get oriented, and write no code. By the end of it you can say what Clean Architecture is for, what it costs us, and which folder we open in Module 2.
Clean Architecture is documented everywhere. A hundred articles show the same four circles, and dozens of templates hand us the folders for free.
Here is the question this course is built around. If the topic is documented that well, why does almost every real Clean Architecture codebase turn into a mess?
Two ways of learning Clean Architecture are common, and both skip the part that matters.
The first way is to memorize the diagram. We learn the ring names and the direction of the arrows, and we can redraw the picture on a whiteboard. Then we sit down to write a feature, we ask where this code goes, and the diagram says nothing back.
The second way is to clone a template. We start from someone’s reference solution and fill in the blanks. That feels productive, and for a while it is. We made none of its decisions, so we cannot judge them. A year later our codebase only looks like Clean Architecture on the outside, and inside it is the same layered mess it always was.
We take a different path here. By the end of the course, you will not only recognize Clean Architecture. You will be able to explain the reasoning behind every abstraction we add, and to say when breaking the rules is the better call.
That last part is the real skill. The ability interviews probe for is judgment. We have to know which abstraction earns its place, and which one is ceremony. Ceremony is code that exists to satisfy a pattern rather than to solve a problem.
So one question comes back in almost every lesson we write. Did this abstraction earn its place? Does it remove real pain for us? If it does not, it does not go in.
This course is not a clone-the-template course. We build everything by hand, including our own small mediator, so nothing in our final solution is magic to you. And we are honest about where Clean Architecture is the wrong choice.
We wrote this for working .NET developers comfortable with C# and the basics of ASP.NET Core. You need no prior exposure to CQRS (command query responsibility segregation), value objects, the mediator pattern, or the Repository and Specification patterns. We teach all of them from zero.
One application runs through the whole course, and we chose it on purpose: an Event Ticketing system with real business rules. We cannot oversell a venue, prices come in tiers, and two buyers can race for the last ticket. Rules like those force a real domain layer to exist.
We meet that application first as a working but badly built web API (application programming interface). We feel why it hurts, and then we rebuild it into something clean and fully tested.
Think back to the last .NET codebase you worked on. Which change in it took five files to make? And which class in it would you have to start a database to test?
Figure 0.1 lays out that road. Notice that every phase ends with something you can hold up at work, and that our building phase is the longest.
You can now say what this course promises and what it refuses to do. New term in this lesson: ceremony. In the next lesson we look at the diagram everyone memorizes, and find the part of it that is the actual skill.