Context: App that handles multi role. A view that in the template has a lot of conditioned rendering.
a) It is better to have a lot of conditioned rendering on the of a single view ?
b) Have a view for each role and condition it accordingly ?
If I choose option a) I would only have one component with the template very conditioned. I would avoid repeating code, but it would be difficult to maintain and scale if tomorrow I want to add 10 more roles.
If I choose option b) I would be keeping the code readable, maintainable, easy to scale. But I would be repeating a lot of code.
Personally I would choose option b) and sacrifice the time to write more code but that keep the project tidy up.
What do you think ? Another alternative to handle this scenario will be appreciated. Regards!
Aucun commentaire:
Enregistrer un commentaire