﻿namespace Dike.Core.Specifications
{
    /// <summary>
    /// Represents a base class for composite specification.
    /// </summary>
    /// <typeparam name="T">The type of the object to which the specification is applied.</typeparam>
    /// <seealso cref="Dike.Core.Specifications.Specification{T}" />
    /// <seealso cref="Dike.Core.Specifications.ICompositeSpecification{T}" />
    public abstract class CompositeSpecification<T>
        : Specification<T>, ICompositeSpecification<T>
    {
        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="CompositeSpecification{T}"/> class.
        /// </summary>
        /// <param name="left">The left of the specification.</param>
        /// <param name="right">The right of the specification.</param>
        protected CompositeSpecification(ISpecification<T> left, ISpecification<T> right)
        {
            Left = left;
            Right = right;
        }

        #endregion Constructors

        #region Properties

        /// <summary>
        /// Gets the left side of the specification.
        /// </summary>
        /// <value>The left side of the specification.</value>
        public ISpecification<T> Left
        {
            get;
        }

        /// <summary>
        /// Gets the right side of the specification.
        /// </summary>
        /// <value>The right side of the specification.</value>
        public ISpecification<T> Right
        {
            get;
        }

        #endregion Properties
    }
}