BLL:public class TestBll { ITestDal dal = TestFactory.CreateDal(); public string GetData() { return dal.GetData(); } } IDAL: public interface ITestDal { public string GetData(); } DAL: public class TestDal : ITestDal { public override string GetData() { return "test"; } } Factory: public class TestFactory { public static ITestDal CreateDal() { return new TestDal(); } }
温馨提示:答案为网友推荐,仅供参考