RE: UI Validation in NTier
From: chrisckx (chrisckx_at_discussions.microsoft.com)
Date: 06/22/04
- Previous message: Hani Atassi: "RE: Watching proxy objects in the debugger?"
- In reply to: Piers: "RE: UI Validation in NTier"
- Next in thread: Piers: "RE: UI Validation in NTier"
- Reply: Piers: "RE: UI Validation in NTier"
- Reply: Piers: "RE: UI Validation in NTier"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 22 Jun 2004 11:24:02 -0700
Piers,
Have you considered abstracting your business rules in some generic XML format that can the be edited at will for adding/removing rules, but that any tier can read and interpret as needed for their side, be it UI validation or server side validation.
Good luck,
Chris.
"Piers" wrote:
> Thanks for the reply Luke
>
> I was thinking that option 3 would be a one off call to the middle tier, by the web server, for all the rules, which would then be cached. The web server would then dynamically add the rules to the JavaScript of a page. For instance, a control for entering a credit card number would have an associated regular expression validator control. By default the expression set in this validation control would allow any string. However, if the cached rules contain a credit card regular expression, this will be added to validator, as the page is rendered. By retrieving all the rules in one go and caching them on the web server there shouldn't be many round trips.
>
> This is dynamic in that it allows rules to be modified or removed. But, unless all controls are rendered with a validator by default (or there is some mechanism to dynamically add a validator), it does not allow new rules to be added. Perhaps a truly generic solution is not possible without considerable processing overhead.
>
> As an aside, a fourth option would be a combination of 2 and 3. The risk validation class could also expose some read only properties such as CreditCardRegExp, these could be used to set the validation rules in web form validator controls or windows form event handlers. However, this still needs some hard coded knowledge of which rules apply to which controls. Also any change to the rules requires the rollout of a new assembly.
>
> Piers
- Previous message: Hani Atassi: "RE: Watching proxy objects in the debugger?"
- In reply to: Piers: "RE: UI Validation in NTier"
- Next in thread: Piers: "RE: UI Validation in NTier"
- Reply: Piers: "RE: UI Validation in NTier"
- Reply: Piers: "RE: UI Validation in NTier"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|