DEV Community

Discussion on: How close to the data you like to have your business logic operations?

Collapse
 
andreujuanc profile image
Juan C. Andreu

UI Validation does not cover all the validations necessary. So, it's pretty common to have them "redundant" through deeper layers.
Example: "name" is mandatory for the UI to have a quick feedback to the user about his small mistake leaving it empty, but the API almost must have this validation as well. But then, suddenly, a wild mobile app appears, and you need to implement this validation again for offline use!

Thread Thread
 
kspeakman profile image
Kasey Speakman

Yep, it's one of those areas where there are significant trade-offs to set it up in a unified manner. It will be worth it in some cases (especially where you have a lot of different clients) but not in others.