Template10 Validation Design Questions

Created on 9 Jan 2018  路  5Comments  路  Source: Windows-XAML/Template10

I am looking for a clean and concise form validation library suitable for UWP. Right now Template10.Validation appears to be high on the list, but its programming model differs from more established ones found in ASP.NET/MVC and NET Forms.

Template10.Validation's documentation concisely describes how to apply it to a Model, but it's unclear wether it can also be applied to a ViewModel. It states the model must be able to inherit from a new base class. If this means it won't work with a ViewModel, then violates the separation of concerns principle, making it less than ideal. Why require coding additional classes, or contaminating exiting ones, for the sole purpose of validating user input? The ViewModel was intended for this purpose. Am I missing something here?

On other .NET platforms, such as ASP.NET MVC, forms validation is simple, concise, elegant, yet powerful. Class members are decorated with validation requirements using attributes. Template10.Validation, on the other hand, doesn't use them. While it's own method isn't particularly onerous, it begs asking why it wasn't used. I can only guess it's due to unimplemented functionality in the "newer" .net infrastructure. Am I correct, or is there another reason?

question

Most helpful comment

Hope to support XF in three months.

All 5 comments

Man, I'm using T10.Validation with MVVM pattern without a problem!!! on the UWP app that i'm developing right now!!!

Because T10 view-models want to use ViewModelBase and because T10.Validation uses ValidModelBase it's not going to be straight forward to apply Validation to your view-model without some custom code.

It's a worthwhile conversation to point out that the view-model is not a model. If it is anything, it operates as a facade to a model. If all of your data is exposed through your view-model as if it is a model, you are necessarily doing it wrong, but it's quite unusual.

Hey Jerry, You are my favorite developer, hopefully one day, i can be as great as you are!!! I love T10 validation, I'm gonna finish my app in three more months and then i'll begin my same app with xamarin.forms I guess I'll have to build up my own T10.Validation project for Xamarin.
Thanks for such amazing library!!!

Hope to support XF in three months.

Yeah, I'll get it into a standard library. That will break pre-FCU UWP apps. But, it's okay.

Was this page helpful?
0 / 5 - 0 ratings