标签:.com 分离 isp one exception int code 分享 eth
public class SubSystemOne { public void MethodOne(){ System.out.println(" 子系统方法一"); } } public class SubSystemTwo { public void MethodTwo(){ System.out.println(" 子系统方法二"); } } public class SubSystemThree { public void MethodThree(){ System.out.println(" 子系统方法三"); } } public class SubSystemFour { public void MethodFour(){ System.out.println(" 子系统方法四"); } } public class Facade { private SubSystemOne one; private SubSystemTwo two; private SubSystemThree three; private SubSystemFour four; public Facade() { one = new SubSystemOne(); two = new SubSystemTwo(); three = new SubSystemThree(); four = new SubSystemFour(); } public void MethodA() { System.out.println("\n方法组A()-----"); one.MethodOne(); two.MethodTwo(); four.MethodFour(); } public void MethodB() { System.out.println("\n方法组B()-----"); two.MethodTwo(); three.MethodThree(); } } public class TestUtil { public static void main(String[] args) throws CloneNotSupportedException { Facade facade = new Facade(); facade.MethodA(); facade.MethodB(); } }
标签:.com 分离 isp one exception int code 分享 eth
原文地址:https://www.cnblogs.com/fatRabbit-/p/10201030.html