I have a choice.
Option 1:
public class Sample
{
bool IsRelevant { get; set; }
}
Option 2:
public class Sample
{
}
public class RelevantSample : Sample
{
}
Is there a clear well-known rule how to make this decision?
My research: I have heard about "Replace Conditional with Polymorphism" refactoring before, but it usually deals with large switch statements:
https://sourcemaking.com/refactoring/replace-conditional-with-polymorphism
https://stackoverflow.com/questions/234458/do-polymorphism-or-conditionals-promote-better-design
There is a somewhat related question that describes a different situation (flag as a method argument rather than part of a domain entity): Is it wrong to use a boolean parameter to determine behavior?