using System;
namespace ZeroLevel.Patterns.DependencyInjection
{
///
/// Dependency resolver
///
public interface IResolver
{
#region Activator
///
/// Creating an instance of an object of the specified type
///
/// Contract or instance type
/// Dependency name
/// Instance
T CreateInstance(string resolveName = "");
///
/// Creating an instance of an object of the specified type
///
/// Contract or instance type
/// Ctor agrs
/// Dependency name
/// Instance
T CreateInstance(object[] args, string resolveName = "");
///
/// Creating an instance of an object of the specified type
///
/// Contract or instance type
/// Dependency name
/// Instance
object CreateInstance(Type type, string resolveName = "");
///
/// Creating an instance of an object of the specified type
///
/// Contract or instance type
/// Ctor agrs
/// Dependency name
/// Instance
object CreateInstance(Type type, object[] args, string resolveName = "");
#endregion
#region Resolving
///
/// Dependency resolve
///
/// Contract
/// Compose the object when true
/// Instance
T Resolve(bool compose = true);
///
/// Dependency resolve
///
/// Contract
/// Dependency name
/// Compose the object when true
/// Instance
T Resolve(string resolveName, bool compose = true);
///
/// Dependency resolve
///
/// Contract
/// Ctor agrs
/// Compose the object when true
/// Instance
T Resolve(object[] args, bool compose = true);
///
/// Dependency resolve
///
/// Contract
/// Dependency name
/// Ctor agrs
/// Compose the object when true
/// Instance
T Resolve(string resolveName, object[] args, bool compose = true);
///
/// Dependency resolve
///
/// Contract
/// Compose the object when true
/// Instance
object Resolve(Type type, bool compose = true);
///
/// Dependency resolve
///
/// Contract
/// Dependency name
/// Compose the object when true
/// Instance
object Resolve(Type type, string resolveName, bool compose = true);
///
/// Dependency resolve
///
/// Contract
/// Ctor agrs
/// Compose the object when true
/// Instance
object Resolve(Type type, object[] args, bool compose = true);
///
/// Dependency resolve
///
/// Contract
/// Dependency name
/// Ctor agrs
/// Compose the object when true
/// Instance
object Resolve(Type type, string resolveName, object[] args, bool compose = true);
#endregion
#region Safe resolving
object TryResolve(Type type, out object result, bool compose = true);
object TryResolve(Type type, object[] args, out object result, bool compose = true);
object TryResolve(Type type, string resolveName, out object result, bool compose = true);
bool TryResolve(out T result, bool compose = true);
bool TryResolve(object[] args, out T result, bool compose = true);
bool TryResolve(string resolveName, out T result, bool compose = true);
bool TryResolve(string resolveName, object[] args, out T result, bool compose = true);
bool TryResolve(Type type, string resolveName, object[] args, out object result, bool compose = true);
#endregion
}
}