Compact Framework?

Aug 16, 2008 at 7:49 AM
Any idea if this validation framework will work under the Compact Framework 3.5?


  -- Vikram
Aug 18, 2008 at 3:18 AM
I just checked in version for the compact framework.
open the ValidationCompact.sln

Some issues
-cant run all the unit test due to typemock not supporting the compact framework
-due to some limitations in the compact framework some of the more complex inheritance scenarios will fail. I will get around to fixing them in the next few days.

let me know how u go.
Aug 18, 2008 at 7:28 AM

That's awesome.  Thanks for all this great work.

Is there a way to associate a severity level or error type with each rule?  It would be useful to be able to display different kinds of icons for the tooltip on forms, depending on specific broken rules.

 -- Vikram
Aug 18, 2008 at 9:35 AM

I have thought about severity a few times and always decided not to for a few reasons
  • trouble deciding what the various severities would be
  • despite being a simple requirement it has a significant impact on performance
  • the implementation of severity would make the implementation much more difficult.

There is however a way to "group" or "classify" Rules. Every rule has a "RuleSet" property. You can then validate rule groups based on this property.
have a look at "Validation\QuickStarts\QSWindowsApplicationCSharp\RuleSetForm.cs"
Although you probably want to do a get latest. I discovered a bug in the previous checkin (added test and fixed now).

I noticed your comment on the TypeMock forum.
Pity about that :(  I added my two cents.
Aug 18, 2008 at 6:14 PM

I was thinking of a really simple implementation of severity/errortype -- just a single int16 property for each rule that the user could set and get.  So you could do something like:

[RequiredStringRule(InitialValue = "aaa", IgnoreCase = true, TrimWhiteSpace = false, ErrorType = 1)]
So the user could set up their own convention for what that int16 value would mean, as in 1 = Critical, 2 = Warning, and so on, and grab it when the rule is broken.  You could then use the very useful RuleSet for grouping by priority and so on.  I'm not sure if this would cause the implementation and performance difficulties that you spoke about.

Hope the TypeMock folks can do their stuff for the CF.  As of now, I couldn't find any mocking framework that would work on the CF.

  -- Vikram
Sep 17, 2008 at 1:37 PM

Any luck with the CF version?