Presenting a generic Effectivity

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.

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackbacks and Pingbacks: