I was reading this blog post on ASP.NET MVC 2's new model validation and found it to be pretty cool. I see the value in keeping things DRY by adding a couple attributes to a class property and then automagically getting client and server side validation (as long as your controller checks for valid models).
That said, imagine an ASP.NET MVC application in a greater context. Perhaps I have an ASP.NET MVC application with this validation and all, but then I want to expose things to new clients, like an iPhone or Android application (not just a mobile browser). I would have to write some web-services or something that use the same underlying repositories/services that my ASP.NET MVC app uses. Could I re-use this validation stuff?
Wouldn't I have to re-write the client-side validation? I don't see a way around this, since I'll be shipping off serialized objects to be de-serialized into non-C# classes from Objective-C or whatever.
Wouldn't I also have to re-write the server-side validation? Is there some way for me to call into the ModelState on an object outside the context of an ASP.NET MVC controller (e.g., as part of the web-services I create to talk to mobile clients).