facade外观模式
internal class Wheel { public void WAction1() { } public void WAction2() { } }
internal class Engine { public void EAction1() { } public void EAction2() { } }
internal class Controller { public void CAction1() { } public void CAction2() { } }
internal class BodyWork { public void BAction1() { } public void BAction2() { } }
public class TankFacade { Wheel[] wheels = new Wheel[ 4 ]; Engine[] engins = new Engine[ 4 ]; BodyWork body = new BodyWork(); Controller control = new Controller(); public void Start() { control.CAction1(); engins[ 0 ].EAction1(); engins[ 1 ].EAction1(); wheels[ 0 ].WAction1(); wheels[ 1 ].WAction2(); } public void Stop() { } public void Run() { } public void Shot() { } }
例如提供API
posted on 2013-04-03 15:23 HOT SUMMER 阅读(212) 评论(0) 编辑 收藏 举报