Tim Van Wassenhove

Passionate geek, interested in Technology. Proud father of two

19 May 2008

Presenting a generic Effectivity

Very often we have to manage objects and their changes over time. Usually we implement this by adding a Range 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.