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/

Comments

  1. With the current state of the Delphi language you won't be happy with any solution similar to this because:

    - 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/

    ReplyDelete
  2. You can try the D-Sharp framework with a custom binding and validation.
    SVN is here: http://delphisorcery.googlecode.com/svn/trunk

    ReplyDelete
  3. My mainly goal is to make validation  of forms controls in the most compact manner , a code like this

    http://pastebin.com/6A1zu7HG

    so maybe a validation framewok is not required

    ReplyDelete
  4. 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.

    (*) given the GUI controls are supported by your MVVM framework.

    ReplyDelete
  5. 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  ...

    ReplyDelete
  6. With 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.

    ReplyDelete
  7. OK thanks for advice Stefan Glienke , I'll have a look these dataset properties and events !

    ReplyDelete
  8. Jedi VCL has a component library for that.
    I've used it in the past and it's alright - not superb - but it works.

    A

    ReplyDelete

Post a Comment