DEV Community

Discussion on: Clean Architecture: Applying with React

Collapse
 
xchiro profile image
Jorge "Chiro" Nuñez Delgado • Edited

Sorry but I do not share the same ideas, Uncle Bob its clear here, the web is a detail, its a delivery mechanism, if your web contains business logic, you are not doing Clean Arch, you can still follow SOLID principles, but not is Clean Arch, React it's a pure front-end tool, I don't see any case where you need to write your uses cases in React/front-end, because the front-end in a correct Clean Arch it is a lower layer, if you are writing your uses cases in front-end, in my opinion, its a bad design, unless, if your web application does not contain a back-en, but that not is a real case.

Thread Thread
 
sutt0n profile image
Joseph Sutton

You can separate entities and their use cases from the engineering-scoped frontend entirely — the computeds I referenced (thought I typed it out, my apologies) would call these entities and their use-cases.

Thread Thread
 
rubemfsv profile image
Rubem Vasconcelos

Exactly. In cases of working like this with React, if you need to develop an app in React Native, writing your use cases and separate entities saves you a lot of time because you can reuse many parts. This text approach is not perfect, it needs a separate presenter and view layer for better decoupling, but yes, you can use clean architecture in frontend web applications. Uncle Bob talks about framework and language agnostic architectures, and front end situations apply. In the case of the frontend, the web detail can be considered the framework (React, Angular, Vue), and to change the detail, just change the layer that contains information regarding the framework.

Thread Thread
 
xchiro profile image
Jorge "Chiro" Nuñez Delgado

If you are following clean architecture principles in a web system with back end, you front end only need the MVC pattern. And in the controllers you can set references to your use cases, but again in real world the uses cases lives in the back end not in the front end, in my opinion use clean architecture in tools like React not is necessary in most of the case.