Thank you very muche Geert for your answer.
I think that sometimes I work so much time that I stop thinking for a moment before asking something properly :)
But I was thinking about mi question and I like to share my thoughts with you if you allow me...
The typical scenario is something like this...
Let's say we have a DataWindow to send a shopping order... but we want to validate two different things at two different times... for example.
I want to validate that a User put enough information about himself... (for example his address or whatever... ) When you press OK ValidateFields and ValidateBusinessRules are called and that's perfect for this.
But... a moment before that I like to validate something BEFORE adding an item to the shopping cart...
I have two options here... (because I don't want to validate the user's address yet... perhaps we didn't event allow him to enter it...)
. Call a different validation function (I don't like this idea because I have tested and setting a bussines rule error from the model does not seem to update the InfoBar Control, and it's bad for design consideretions also).
. The second approach ( I like this .. but I'd like your opinion about... ) is either to use a ValidationFields (ValidationBusinessRules) method based on states, so that different validations are made according to the current state. Or, use some kind of
dynamic validator inside the functions, for example a dictionary where every key is a state and every entry is a validation rule, and reference it inside the proper functions.. something like:
You know the idea...
I appreciate some feedback from you. Thanks again for your support