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

设计模式

状态模式

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

中介者模式

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

职责链模式

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

模板方法模式

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

命令模式

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

解释器模式

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

观察者模式

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

访问者模式

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

迭代器模式

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

策略模式

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

备忘录模式

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

组合模式

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

装饰模式

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

享元模式

canca19年前 (2007-03-26)556
//享元模式//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)517
//外观模式//CopyRight(C)CAnca Software Office. 2006//Created by CAnca. public class FacadeMode{ public static void main(String[] args){  Fa…