You cannot define static members via the interface, so if static members are required by design they can only be added to concrete types.
This ultimately produces a lot of confusion. Any other implementation would not have that same member. Mocked instances will not have access to that member. And so on.
Solution is to avoid declaring static members. In your particular case, I would object to the very design of the interface. I would prefer to see classes implement some interface like IValidatable:
public interface IValidatable
{
bool IsValid();
}
...
public class SomeBoolClass: IValidatable
{
private bool Data;
public bool IsValid()
{
return this.Data; // i.e. return Data == true
}
}
...
public class SomeStringClass: IValidatable
{
private string Data;
public bool IsValid()
{
return !string.IsNullOrEmpty(this.Data);
}
}
In this way you obtain fully polymorphic validation across all current and future types.
If you insist on having a validator which receives low-level data (such as Boolean or string) to validate, then you are half-way doomed. Suppose that there are two classes which wrap string data. These two classes would normally have to be validated in different ways. But validator would not be able to distinguish which validation algorithm to apply based on input data. Even worse, validator would have to contain all validation logic for all types, existing and those yet to be coded. This means that validator would act as one giant (and inherently incomplete) switch statement.