finished-flutter-firebase-ddd-course icon indicating copy to clipboard operation
finished-flutter-firebase-ddd-course copied to clipboard

[Discussion] Project structure

Open narcodico opened this issue 4 years ago • 6 comments

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.

narcodico avatar Mar 13 '20 21:03 narcodico

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

pedromassango avatar Mar 13 '20 22:03 pedromassango

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.

narcodico avatar Mar 13 '20 23:03 narcodico

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.

fabriziocacicia avatar Mar 18 '20 11:03 fabriziocacicia

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.

ResoDev avatar Apr 16 '20 11:04 ResoDev

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.

Jomik avatar Apr 30 '20 09:04 Jomik

We can always have core folders for commom objects too

pedromassango avatar Apr 30 '20 18:04 pedromassango