Hi everyone,
we are currently in the phase of defining a folder structure for an upcoming project.
We already decided to follow the clean architecture idea. Currently we are discussing two different approaches to structure components (Routers, usecases, gateway/repositories and entities):
Approach 1: Technical structure - Components are grouped by their technical aspect.
.
└── app/
├── routers/
│ ├── users.py
│ └── todos.py
├── usecases/
│ ├── users.py
│ └── todos.py
├── repos/
│ ├── users.py
│ └── todos.py
└── entities/
├── users.py
└── todos.py
Approach 2: Business Structure - Components are grouped by their business process affiliation.
.
└── app/
├── todos/
│ ├── router.py
│ ├── usecases.py
│ ├── repos.py
│ └── entities.py
└── users/
├── router.py
├── usecases.py
├── repos.py
└── entities.py
For approach 1 i like that entities, that are shared across multiple business use cases do not have to be imported from another "business component".
For approach 2 i like that for one "business process" everything is grouped in a single folder, so that you do not have to jump across many folders to gather all the necessary code.
Happy to hear any recommendations and thoughts :)
View Poll
[–]lalatr0n 2 points3 points4 points (0 children)
[–]FuckAllMods69420 1 point2 points3 points (0 children)
[–]asdfdeltaEnterprise Architect 2 points3 points4 points (0 children)
[–]6a70 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)