Constraints are logical conditions on the data of an app. The simplest, and most important, types of constraints are property constraints and object-level constraints.
Constraints should be defined in the model classes of an MVC app, since they are part of their business semantics.
Constraints should be checked in various places of an MVC app: in the UI/view code, in model classes, and possibly in the database.
Software applications that include CRUD data management need to perform two kinds of bi-directional object-to-string type conversions:
Between the model and the UI: converting model object property values to UI widget values, and, the other way around, converting input widget values to property values. Typically, widgets are form fields that have string values.
Do not perform any string-to-property-value conversion in the UI code. Rather, this is the business of the model code.
Responsive validation means that the user, while typing, gets immediate validation feedback on each input (keystroke), and when requesting to save the new data.