Sunday, October 8, 2017

future thoughts

I've had a few conversations about the dynamic forms in Angular 4 with coworkers and whether or not they are a good thing or a bad thing. I don't yet have enough experience to have a strong opinion. I can see how they might speed some things up with easy-to-slap-on validations and how once a dirty flag is true at a control and it thus makes the dirty flag true for the whole of the form you could disable a submit button based upon that with ease. However, should validations just come from the model and be tied to the model? If I have two different forms for the same model am I breaking the DRY principal by writing validations twice? A coworker feels that the validation rulesets should be tied to the models all the way down at the C# level, be serializable and thus handable over the wire to the TypeScript side, be run at the TypeScript side, and then, upon a form submit, be rerunnable at the C# side because you should not trust client-side validations. He apparently has a self-rolled pattern for this and is vocal about how Aurelia solves the problem better. Me? I am still developing an opinion.

No comments:

Post a Comment