我有以下类:
public class AllowanceManager : IAllowanceManager
{
public AllowanceManager(ITranslationManager t_Manager, ISessionManager s_Manager)
{...}
}
public class TranslationManager : ITranslationManager
{
public TranslationManager(string culture)
{...}
}
public class SessionManager : ISessionManager
{
public SessionManager(string key)
{...}
}
我该如何在ObjectFactory中初始化这些类,以便获取IAllowanceManager实例时也自动装配和初始化(使用构造函数参数)StateManager和TranslationManager。这样我只需要像下面这样检索IAllowanceDeduction的实例:
IAllowanceManager a_Manager = ObjectFactory....// Gets Allowancemanager configured with initialized instances of IStateManager and ITranslationManager