Hi,
Some users insist on leaving heavy folder on top of the space bar or just don't understand the concept "separate words with one space". Well sometimes they understand it but accidents happen all the time. Anyway the point is that sometimes we need to correct strings that the user typed:
- trimming extra spaces
- correcting word casing
- automatic spell checking
This need exists for several reasons namely because there is no point on having a unique field for names if users don't leave extra spaces all around.
This is not an UI issue as it is tyed to object validation. Some frameworks do it on the validation methods. As far as I can see, Csla uses validation only to check if everything is all right though I never saw an example of correcting user input. I can see no reason not to do it on validation rules, before all other rules are executed.
FYI - Rocky has commented on this before - he regrets calling them "ValidationRules" - he would prefer to call them BusinessRules instead. For exactly the reason you stated - people only think they can do validation with them. But you can easily correct the input through the use of a rule - just return True in every case. The rule then runs automatically each time the property is changed - so you can capitalize the first letter, trim excess spaces, whatever.
Joe
PS - Rocky "can't" change the name to BusinessRules as that would be a major breaking change!
Copyright (c) Marimer LLC