Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Proper Encapsulation Techniques?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00131613
Message ID:
00132142
Vues:
16
>>Taht depends on exactly what you mean by field level validation. If you are referring to domain constraints it si done by the backend database server, if you eman business rules then it is done by the bizobj, and if you mean assistive validation it is done by the front end.
>
>Wow. Ok, I guess I was thinking of a business rule. For example, a work order's done date must be later than its start date.
>
>If you bind the done date control to the object property WorkOrder.dDone, how would you message the user and return the value of the control to the old value when they enter an invalid done date? (The new _ASSIGN methods will handle this nicely . . . ) Thank you.

Mark,

As soon as you say "message the user" you have identified where this needs to be done, in the suer interface. The bizobj and database have no business showing anything to the user. The bizobj should reject the record when a request to Update comes in. The database should do the same thing. The user interface should tell the user when they have it wrong.

If you divide the validation into three levels, assistive (informs users so they can get things right before they save their work), business rules (additional constraints on the allowable state of a record or field that is beyond the field or record domain constraints), and domain constraints (the data type, range of values, blankness, etc.) then it bcoems clear what should be done where.

The user interface interacts with the user, the bizobj enforces business rules, and the database enforces domain constraints.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform