Let\'s say I have a class like:
class NavigationData
{
float roll;
float pitch;
double latitude;
double longitude;
}
and if I want to c
It depends on the context. Sometimes, your object is absolutely valid internally, but in the context its values aren't acceptable.
If you have simple Data Transfer Object then it probably shouldn't validate itself.
If you have a class of Domain Model then it should do some validation.
P.S. just my personal preference: isValid () instead of validate () when method returns boolean value.