Data validation
mNo edit summary
mNo edit summary
Tag: 2017 source edit
Line 9: Line 9:
Common Types of Data Validation used by MDriven:
Common Types of Data Validation used by MDriven:


* Required Fields
* Required Fields: <code>self.FirstName->IsEmpty</code>  implies "FirstName is required" (Field should not be left empty)
* Data type validation.
* Data type validation: this can be by ensuring the correct data type in selected for the model attribute (String, Date, Datetime, decimal, Float,Blob e.t.c).
* Range validation.
* Range validation <code>(self.DayOfBirth > 0) and (self.DayOfBirth < 32)</code>. The system only expects values between 0 - 31 excluding 0 and 32.
* Format validation such regular expressions for emails.
* Format validation such regular expressions for emails <code>self.EmailAddress.regExpMatch('^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,3}$')</code>.
* Conditional validations.
* Conditional validations.
[[File:Documentation Data validation 1727976784514.png|left|frame]]
[[File:Documentation Data validation 1727976784514.png|left|frame]]
Proceed here with other content

Revision as of 17:49, 3 October 2024

This page was created by Stephanie@mdriven.net on 2024-02-22. Last edited by Edgar on 2025-01-20.

Data or Input validation in MDriven ensures that data entered by users is correct, consistent, and conforms to the business rules of the application before being processed or persisted in the database.

Data validation is important in for the reasons: 

  • Data Integrity
  • Enforcing business rules
  • Data Security

Common Types of Data Validation used by MDriven:

  • Required Fields: self.FirstName->IsEmpty implies "FirstName is required" (Field should not be left empty)
  • Data type validation: this can be by ensuring the correct data type in selected for the model attribute (String, Date, Datetime, decimal, Float,Blob e.t.c).
  • Range validation (self.DayOfBirth > 0) and (self.DayOfBirth < 32). The system only expects values between 0 - 31 excluding 0 and 32.
  • Format validation such regular expressions for emails self.EmailAddress.regExpMatch('^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,3}$').
  • Conditional validations.
Documentation Data validation 1727976784514.png

Proceed here with other content