Welcome to Modular Monolith Architecture in .NET.
As you probably know, we’re always committed to creating practical and hands-on materials. We rarely delve too much into theory or explain concepts painstakingly. We love learning by building things ourselves, so we teach that way, and many of you prefer learning this way too.
This course is no different. From the first module, we work on one real .NET application, and we change its structure while it keeps running.
What You Will Learn
We are going to take one ASP.NET Core application, called Fieldwork, and split it into modules one step at a time, from start to finish. Along the way we will:
- Measure the coupling in an existing application with a test.
- Choose which part of the application becomes the first module.
- Move the customer features into a module of their own while the application keeps running.
- Send every call into a module through its public contract.
- Give every module its own data and its own migrations.
- Pass changes between modules with events that still arrive after a crash.
- Run a billing process across four modules without a shared transaction.
- Make a forbidden reference between two modules fail the build.
- Merge two modules back into one when the split was wrong.
- Move one module into a service of its own, and list what got worse.
Every lesson adds one thing you can do that you could not do before. By the end, you will be able to split a large .NET application into modules and keep the boundaries between them in place with tests.
Who This Course Is For
This course is for .NET developers who work on one large application that has grown hard to change. An application like that rarely gets rewritten, because the business needs it every day. The developers who already know it have to improve it in place.
If you have changed one feature and broken another one that nobody touched, you are in exactly the right place. Most of this course is about drawing boundaries inside the application, so that a change stays inside the module where we made it.
We assume you know C#, ASP.NET Core and Entity Framework Core, and that you are comfortable in a terminal. We also assume you have met layered or Clean Architecture. If you want a refresher, our Clean Architecture in .NET course covers it.
We do not assume you have ever split an application into modules, or worked on one that someone else split.
Once we finish, you can change one area of the application you work on without breaking another. You can also show your colleagues where that area ends and the next one begins.
What the Course Does Not Cover
A few topics sit close to this one, and we leave them out:
- A system of many services. We move exactly one module into its own service, in module 14, and we stop there. Our Microservices in .NET course covers the case with many services.
- Authentication and multi-tenancy. Fieldwork has no sign-in and serves one company, so every request in the course runs without a token.
- Comparisons of messaging libraries. We build the messaging by hand, so you can see every part of it, and the bonus module 17 replaces it with Wolverine and RabbitMQ.
How We Teach
From module 1 on, we change Fieldwork in small steps. After every lesson, the build passes and the application still answers every request it answered before.
Our recommendation is to follow along and run everything yourself. Read the lesson, then open your terminal and do the same thing. Lesson 0.5 shows how to compare what your terminal prints with what ours printed.
We wrote the course against the .NET 10 SDK (software development kit), version 10.0.302, with Entity Framework Core 10.0.11. Lesson 0.6 lists every update, with its date.
In the next lesson, we check your machine for the .NET 10 SDK and an editor. And if you get stuck or need any help, do let us know, and we’ll get back to you very quickly.
Happy coding!