finished-flutter-firebase-ddd-course
finished-flutter-firebase-ddd-course copied to clipboard
[Discussion] Project structure
First of all nice approach and some heavy work you did here. Secondly, I feel like a per feature structure would be really beneficial, since you'd get everything in one place. Having to navigate between folders when working on a specific feature is pretty annoying I'd say.
I agree. I was thinking if we can have the project structure but for each feature:
auth:
- presentation
- domain
- infrastructure
chat:
- presentation
- domain
- infrastructure
I think that with this structure it is more easy to refactor or work in a feature
If we could stay away from creating folders as much as we can, that'd be great, since having deeply nested folders is painful. Having a shared
folder at the feature level containing all kind of reusable bits would also help I think.
I agree with @pedromassango. This structure lets to achieve a better modularization of the project: in this way a developer or an entire team can work to features in a more isolated manner avoiding to touch parts of the structure that other developers are working on reducing possible conflicts.
Pardon me for the late reply. I found that creating folders on a per-feature basis makes navigating around the project harder, actually. What @pedromassango proposes is fine and it's how the project was structured in the clean architecture series. Either organization is fine, it's really up to your preference.
A shared "feature" is a good idea, @RollyPeres.
@fabriziocacicia I'm not sure I entirely agree on this one. Developers can still work on just one feature, let's say it's "auth". No matter how the folders are structured, the developer doesn't have to venture into other features' code to write "auth" code.
Are features completely decoupled from other features? Because if they are, then either structure makes sense. If they are not, then I think it makes sense to have feature folders in the layer folders, such that feature A could use stuff from feature B.
We can always have core
folders for commom objects too