Continuing your journey
The previous project was tiny. It had a shared model that served as the data layer because that model was composed of only a single class. When you are building a bigger application, you will most likely have more than a class, so I'll try to give you a good starting point to tackle bigger apps. The idea is to create slices that are as small as possible, limit interactions with other slices as much as possible, then refactor that code into better code. We cannot remove coupling, so we need to organize it instead.
Here is a workflow that we could call "start small and refactor":
- Write the contracts that cover your feature (input and output).
- Write one or more integration tests that cover your feature, using those contracts; the
Query
orCommand
class (IRequest
) as input and theResult
class as output. - Implement your
Handler
,Validator
,MapperProfile
, and any other bit that needs to be coded. At this point, the code could be a...