Understanding before acting
If you take a look at the 01-monolith_legacy
branch of our ERP example, you’ll notice that the code is somewhat messy. While the project names are clear, it’s difficult to identify any architectural pattern, such as Onion Architecture, Clean Architecture, or even Hexagonal Architecture.
Dig deeper into the code. If you open the program.cs
file in the BrewUp.Rest
project, you will see that every service and endpoint is registered in this file. This means that whenever you need to add, remove, or modify a service or endpoint, you have to update the program.cs
file, the entry point of your application. This approach is far from ideal!
The SalesOrderService
and WarehousesService
files, located in the Services
folder, serve as the façade
of the underlying infrastructure. Placing these files directly in the BrewUp.Rest
project creates a tight coupling with the underlying system. As a result, if you ever need to move one of these services...