展开全部
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(); } }
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询