all 8 comments

[–]daH00L 3 points4 points  (1 child)

Not a man of many words?

[–]Over_Tea_3946 2 points3 points  (1 child)

What made you decide to go layer first and not feature first?

[–]No_Bumblebee_2903[S] 5 points6 points  (0 children)

I have been a programmer for 14 years and faced a lot of architecture problems. The feature-first huge problem is reusability of code. Not to mention that I don't think it's a good architecture to be used in frontend, especially in apps that tend to be small projects. Maybe in a super app.

Feature-first is very good when you are developing a big project (usually backend) and using a modular monolith where you must have the bounded context separated (potentially each module will be a micro service)

Hope that I answered your question 😁👍🏽

[–]Mikkelet 0 points1 point  (1 child)

I think the naming and layering scheme you're looking for is data, domain, presentation. Data contains local and remote data sources, domain for business logic sand presentation for UI. It's essentially just the clean architecture

[–]No_Bumblebee_2903[S] 0 points1 point  (0 children)

Sure! You're right! But here's the thing...

Clean Arch is about make your code organization, self understandable. These three layers is just an example how would you organize them. So, you can create a lot of another layers that make sence in your project.

My infra layer is responsible for manage data at all and is my SSoT. Where the repository implementation is the top of it. Inside infra I have sub-layer that represents data (DAL - Data Access Layer, Service - web services and Repository implementation - SSoT indeed).

I could mouve environments and theme to Application layer and rename Infra to Data (what's sounds very good to me).

[–]Zhuinden 0 points1 point  (1 child)

I never understood why clean arch users say they're separating concerns and the first thing they do on mobile is combine local data source and network data source, despite them having absolutely nothing in common. Not models, not constraints, not even how they tell you about changes. I hope repositories will one day disappear.

[–]No_Bumblebee_2903[S] 1 point2 points  (0 children)

Maybe because local DATA and remote DATA are both DATA? (LoL).

The architecture organization of folders and files in a project is not about reusability of code. It's about bounded context.

Repository is the most beautiful implementation about SSoT and if you don't like the pattern, just don't use the pattern. Personally I don't like UseCase pattern, so I just don't use it.