Very often we have to manage objects and their changes over time. Usually we implement this by adding a Range<DateTime> to the data. Martin Fowler has a name for this pattern: Effectivity and i have an implementation for the following interface:
public interface IEffectivity<t> : IComparable<ieffectivity<t>>
{
T Element { get; }
IRange<dateTime> ValidityPeriod { get; }
bool IsEffectiveOn(DateTime validityDate);
}
Feel free to download IEffectivity.txt, Effectivity.txt and EffectivityTester.txt.
1 Comments.