I have a project to issue invoices. link But I'm going through a cruel doubt.
I want to implement a real clean architecture in the project, but I realize that sometimes people who assemble clean architecture projects over the web have directories with "dirty files" (framework/orm imports...) and "clean files" (without any dependency on any external thing).
However, I found this horrible, since having a framework migration, which should be totally easy to do, ends up being difficult and tedious, since you will need to go from directories to directories looking for the "clean files" to migrate. ..
So I built the following structure:
domain
infra
usecases
In infra all files are dirty... (Controllers, Repositories... )
It is the only layer that will not be migrated.
In usecases it contains the business rules for issuing... This layer is also totally decoupled from any framework and ORM.
But I'm facing a discussion with a friend who claims that directories should contain dirty and clean files together, with the justification that this is the "right" way to do it.
if you look my project, you'll notice that I put adapters and shared inside the domain and my friend prefers that it stays inside the infra layer because, as he said, this is the "right" way to do it. The problem is that this system will be very large and have a large amount of framework change as well, and going from directory to directory looking for clean files to move to another project is a big headache and too tedious.
In yours opinions, do i need to have the adapters and shared directories in the below layer, even if it is "dirty", or am I right in mind them in the domain layer which is an entirely clean layer.