PageRenderTime 24ms CodeModel.GetById 20ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/src/LinFu.IoC/Interfaces/IFactoryStorage.cs

http://github.com/philiplaureano/LinFu
C# | 39 lines | 11 code | 4 blank | 24 comment | 0 complexity | a3009f084c4ff47b8717dcac77fa27d6 MD5 | raw file
 1using System.Collections.Generic;
 2
 3namespace LinFu.IoC.Interfaces
 4{
 5    /// <summary>
 6    ///     Represents a class that stores factory instances.
 7    /// </summary>
 8    public interface IFactoryStorage
 9    {
10        /// <summary>
11        ///     Gets a value indicating the list of <see cref="IServiceInfo" /> objects
12        ///     that describe each available factory in the current <see cref="IFactoryStorage" />
13        ///     instance.
14        /// </summary>
15        IEnumerable<IServiceInfo> AvailableFactories { get; }
16
17        /// <summary>
18        ///     Determines which factories should be used
19        ///     for a particular service request.
20        /// </summary>
21        /// <param name="serviceInfo">The <see cref="IServiceInfo" /> object that describes the target factory.</param>
22        /// <returns>A factory instance.</returns>
23        IFactory GetFactory(IServiceInfo serviceInfo);
24
25        /// <summary>
26        ///     Adds a <see cref="IFactory" /> to the current <see cref="IFactoryStorage" /> object.
27        /// </summary>
28        /// <param name="serviceInfo">The <see cref="IServiceInfo" /> object that describes the target factory.</param>
29        /// <param name="factory">The <see cref="IFactory" /> instance that will create the object instance.</param>
30        void AddFactory(IServiceInfo serviceInfo, IFactory factory);
31
32        /// <summary>
33        ///     Determines whether or not a factory exists in storage.
34        /// </summary>
35        /// <param name="serviceInfo">The <see cref="IServiceInfo" /> object that describes the target factory.</param>
36        /// <returns>Returns <c>true</c> if the factory exists; otherwise, it will return <c>false</c>.</returns>
37        bool ContainsFactory(IServiceInfo serviceInfo);
38    }
39}