标签:说明 实现 oid count() art div zha col new
说明:提供另一套接口对接客户端,隐藏真实接口和功能,也违背了开闭原则。
实现:
public class yuangong { public void add() { //添加员工资料 } } public class yuangong_zhanghao { public void addAccount() { //添加员工的帐号 } } /// <summary> /// 外观 /// </summary> public class waiguan { private yuangong yg; private yuangong_zhanghao ygzh; public waiguan() { yuangong yg = new yuangong(); yuangong_zhanghao ygzh = new yuangong_zhanghao(); } public void add(string a,string b) { yg.add(); ygzh.addAccount(); } } public class test { public void start() { waiguan wg = new waiguan(); wg.add(); } }
标签:说明 实现 oid count() art div zha col new
原文地址:https://www.cnblogs.com/laokchen/p/13540697.html