当前位置:首页 > 设计模式

设计模式

状态模式

canca19年前 (2007-03-26)536
//状态模式//CopyRight(C) CAnca software Office.2006//Created by CAnca.//说明:将状态封装成一个独立的类.状态父类中的方法是状态管理器的方法.//适用于多分支判断,例:画图软件.选择某种工具,有不同的效果出现. public class…

中介者模式

canca19年前 (2007-03-26)629
//中介者模式//CopyRight(C) CAnca software Office.2006//Created by CAnca. public class MediatorMode{ public static void main(String[] args){  …

职责链模式

canca19年前 (2007-03-26)653
//职责链模式//CopyRight(C) CAnca software Office.2006//Created by CAnca. public class ResponsibilityMode{ public static void main(String[] args){ …

模板方法模式

canca19年前 (2007-03-26)699
//模板方法模式//CopyRight(C) CAnca software Office.2006//Created by CAnca. public class TemplateMode{ public static void main(String[] args){ &nbs…

命令模式

canca19年前 (2007-03-26)577
//命令模式//CopyRight(C) CAnca software Office.2006//Created by CAnca. public class CommandMode{ public static void main(String[] args){  R…

解释器模式

canca19年前 (2007-03-26)519
//解释器模式--真实例子//CopyRight(C) CAnca software Office.2006//Created by CAnca. import java.util.*; public class InterpretMode_RealWorld{ public static…

观察者模式

canca19年前 (2007-03-26)558
//观察者模式//CopyRight(C) CAnca software Office.2006//Created by CAnca. import java.util.*; public class ObserverMode{ public static void main(String…

访问者模式

canca19年前 (2007-03-26)601
//访问者模式//CopyRight(C) CAnca software Office.2006//Created by CAnca. import java.util.*; public class VisitorMode{ public static void main(String[…

迭代器模式

canca19年前 (2007-03-26)608
//迭代器模式//CopyRight(C) CAnca software Office.2006//Created by CAnca. import java.util.*; public class IteratorMode{ public static void main(String…

策略模式

canca19年前 (2007-03-26)591
//策略模式//CopyRight(C) CAnca software Office.2006//Created by CAnca. public class StrategyMode{ public static void main(String[] args){  …

备忘录模式

canca19年前 (2007-03-26)523
//备忘录模式//CopyRight(C) CAnca software Office.2006//Created by CAnca. public class MementoMode{ public static void main(String[] args){  …

组合模式

canca19年前 (2007-03-26)589
//组合模式//CopyRight(C) CAnca software Office.2006//Created by CAnca. import java.util.*; public class ComponantMode{ public static void main(String…

装饰模式

canca19年前 (2007-03-26)524
//装饰模式//CopyRight(C) CAnca software Office.2006//Created by CAnca. public class DecoratorMode{ public static void main(String[] args){  …

享元模式

canca19年前 (2007-03-26)634
//享元模式//CopyRight(C) CAnca software Office.2006//Created by CAnca. import java.util.*; public class ShareMode{ public static void main(String[] a…

外观模式

canca19年前 (2007-03-26)609
//外观模式//CopyRight(C)CAnca Software Office. 2006//Created by CAnca. public class FacadeMode{ public static void main(String[] args){  Fa…