Skip to content

Instantly share code, notes, and snippets.

@panesofglass
Created October 26, 2009 16:14
Show Gist options
  • Save panesofglass/218763 to your computer and use it in GitHub Desktop.
Save panesofglass/218763 to your computer and use it in GitHub Desktop.
Interface for the Specification pattern.
namespace Foundation.Specifications
{
/// <summary>
/// Interface for a specification.
/// </summary>
/// <typeparam name="T">The type specified.</typeparam>
/// <seealso href="http://www.lostechies.com/blogs/chrismissal/archive/2009/09/10/using-the-specification-pattern-for-querying.aspx" />
public interface ISpecification<T>
{
/// <summary>
/// Determines whether the specification is satisfied by the specified candidate.
/// </summary>
/// <param name="candidate">The candidate.</param>
/// <returns>
/// <c>true</c> if the specification is satisfied by the specified candidate; otherwise, <c>false</c>.
/// </returns>
bool IsSatisfiedBy(T candidate);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment