说明
我认为三层架构中的BLL,Service,BusinessFacade都是门面模式的体现,封装逻辑细节的实现和复杂数据的展示,只提供给应用简单的接口调用.上层应用可以不关注逻辑细节和数据是从哪里来的.
class Logic1 { public void Exc() { Console.WriteLine("执行Logic1完成"); } } class Logic2 { public void Exc() { Console.WriteLine("执行Logic2完成"); } } public class LogicFacade { Logic1 logic1; Logic2 logic2; public LogicFacade() { logic1 = new Logic1(); logic2 = new Logic2(); } public void Exc() { logic1.Exc(); logic2.Exc(); Console.WriteLine("Logic全部执行完成"); } } LogicFacade logicFacade = new LogicFacade(); logicFacade.Exc();
时间: 2024-11-05 17:29:41