一 、配置項 ci
<add key="DalPath" value="Company.Project.BLL" /> get
<add key="DalValue" value="ControllerManager" />string
2、反射建立BLL管理控制器io
public static ControllerManager Instance() class
{ 配置
if (bllManager == null) 反射
{ static
string path = ConfigurationManager.AppSettings["DalPath"];sse
string value = ConfigurationManager.AppSettings["DalValue"];new
Type type = Assembly.Load(path).GetType(path + "." +value);
ConstructorInfo ci = type.GetConstructor(System.Type.EmptyTypes);
bllManager = (ControllerManager)ci.Invoke(null);
}
return bllManager;
}
3、BLL層管理控制器
public class ControllerManager
{
public ABLL aBLL
{
get
{
return new ABLL();
}
}
public BBLL bBLL
{
get
{
return new BBLL();
}
}
}