AFAIK, there is no Validation Framework in Delphi, something similar to this
AFAIK, there is no Validation Framework in Delphi, something similar to this
http://fluentvalidation.codeplex.com/
Should I (or someone else) create one (even a basic one) ?
http://fluentvalidation.codeplex.com/
http://fluentvalidation.codeplex.com/
Should I (or someone else) create one (even a basic one) ?
http://fluentvalidation.codeplex.com/
With the current state of the Delphi language you won't be happy with any solution similar to this because:
ReplyDelete- anonymous method syntax is to verbose / no lambdas (see Gabrs blog article)
- no type inference -> you end up having to specify the generic parameters often -> verbose code
For the next version of DSharp MVVM there is a validation framework that mostly works with attributes you can define on your viewmodel/model. It is a bit similar to http://mvvmvalidation.codeplex.com/
You can try the D-Sharp framework with a custom binding and validation.
ReplyDeleteSVN is here: http://delphisorcery.googlecode.com/svn/trunk
My mainly goal is to make validation of forms controls in the most compact manner , a code like this
ReplyDeletehttp://pastebin.com/6A1zu7HG
so maybe a validation framewok is not required
If you go the complete way of MVVM you don't apply the validation on the GUI controls but on the viewmodel/model behind it. That makes it unit testable and you can easily(*) change the GUI controls if you like.
ReplyDelete(*) given the GUI controls are supported by your MVVM framework.
I totally agree with you Stefan Glienke ; the point is that i must create verifications on a hundred of controls that I put on the first Delphi app I created one year ago, using the good ol'way of Delphi : DB => DataSet=> DBControl ...
ReplyDeleteWith datasets it's usually easier to implement that using the editmask or the OnValidate event of the fields. If you are using the DevExpress controls for example I think there are additional events/properties to use on the controls.
ReplyDeleteOK thanks for advice Stefan Glienke , I'll have a look these dataset properties and events !
ReplyDeleteJedi VCL has a component library for that.
ReplyDeleteI've used it in the past and it's alright - not superb - but it works.
A
ty Andrea Raimondi
ReplyDelete