Click here to Skip to main content
15,896,493 members
Articles / Web Development / HTML

Transformalizing NorthWind

Rate me:
Please Sign up or sign in to vote.
4.95/5 (29 votes)
24 Jul 2014GPL37 min read 57.8K   341   53  
Combining de-normalization, transformation, replication, and awesome-ness.
#region License
// /*
// See license included in this library folder.
// */
#endregion

using System;
using System.Collections.Generic;
using Transformalize.Libs.Ninject.Activation;
using Transformalize.Libs.Ninject.Parameters;

namespace Transformalize.Libs.Ninject.Planning.Bindings
{
    /// <summary>
    ///     The configuration of a binding.
    /// </summary>
    public interface IBindingConfiguration
    {
        /// <summary>
        ///     Gets the binding's metadata.
        /// </summary>
        IBindingMetadata Metadata { get; }

        /// <summary>
        ///     Gets or sets the type of target for the binding.
        /// </summary>
        BindingTarget Target { get; set; }

        /// <summary>
        ///     Gets or sets a value indicating whether the binding was implicitly registered.
        /// </summary>
        bool IsImplicit { get; set; }

        /// <summary>
        ///     Gets a value indicating whether the binding has a condition associated with it.
        /// </summary>
        bool IsConditional { get; }

        /// <summary>
        ///     Gets or sets the condition defined for the binding.
        /// </summary>
        Func<IRequest, bool> Condition { get; set; }

        /// <summary>
        ///     Gets or sets the callback that returns the provider that should be used by the binding.
        /// </summary>
        Func<IContext, IProvider> ProviderCallback { get; set; }

        /// <summary>
        ///     Gets or sets the callback that returns the object that will act as the binding's scope.
        /// </summary>
        Func<IContext, object> ScopeCallback { get; set; }

        /// <summary>
        ///     Gets the parameters defined for the binding.
        /// </summary>
        ICollection<IParameter> Parameters { get; }

        /// <summary>
        ///     Gets the actions that should be called after instances are activated via the binding.
        /// </summary>
        ICollection<Action<IContext, object>> ActivationActions { get; }

        /// <summary>
        ///     Gets the actions that should be called before instances are deactivated via the binding.
        /// </summary>
        ICollection<Action<IContext, object>> DeactivationActions { get; }

        /// <summary>
        ///     Gets the provider for the binding.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <returns>The provider to use.</returns>
        IProvider GetProvider(IContext context);

        /// <summary>
        ///     Gets the scope for the binding, if any.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <returns>
        ///     The object that will act as the scope, or <see langword="null" /> if the service is transient.
        /// </returns>
        object GetScope(IContext context);

        /// <summary>
        ///     Determines whether the specified request satisfies the condition defined on the binding,
        ///     if one was defined.
        /// </summary>
        /// <param name="request">The request.</param>
        /// <returns>
        ///     <c>True</c> if the request satisfies the condition; otherwise <c>false</c>.
        /// </returns>
        bool Matches(IRequest request);
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
Software Developer (Senior)
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions