Search⌘ K

Constraint Validation in MVC Applications

Understand where and how to perform data validation in MVC applications to maintain data integrity. Explore the challenges of multiple validation layers and discover practical methods using JavaScript and declarative annotations to ensure both usability and robust backend enforcement.

We'll cover the following...

Where to perform validations

Integrity constraints should be defined in the model classes of an MVC application since they’re part of the business semantics of a model class (representing a business object type). However, a more difficult question is where thedata validation should be performed. It can be performed in the database, the model classes, the controller, the user interface, or in all of them.

A relational database management system (DBMS) performs data validation whenever there’s an attempt to change data in the database, provided that all relevant ...