Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Field-level rules vs. code in the Valid event
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00096287
Message ID:
00097350
Views:
49
>I handle all of my application validations with an OLE Automation object, which I instantiate at the beginning of all my apps (and when I'm working in VFP, as part of my startup PRG). The OLE object does one task...it uses a parameterized view (or a SELECT, if you prefer) to query a table full of rules/validations, applies those rules in the desired order, and returns a pass/fail. Obviously, if there are no validations in the table for that item, the OLE object returns "pass".
>
>This accomplishes several things. It's truly OOP, because you only code a validation once (when you put it into the table). Since the actual code performing the validation is kept in a simple VFP free table, It's easy to write a tool to maintain these validations. More importantly, it *centralizes* all of the validations for ALL of my development in a single location (I keep that table in the same place I keep my development-level classes, so it's always in the same location). I can compile all or part of that table directly into an application). And it's scaleable, if I ever need to, simply by making the view remote instead of local and upsizing a free table.
>
>For this particular case, it would also make the creation of the message the resposibility of the piece of code that messages the OLE automation server. This means that the user can handle a failed validation however they want.
>
>Just another approach...but if anyone's interested, I'll be glad to share this. It's really trivial...took me about two hours to get it working.
>
>Evan Pauley


I have some reservations with this method when moved to the server? How are you getting the data back and forth to be validated, especially when validating the entire record rather than just a field?
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform