zno2

随笔分类 -  《DesignPatterns》

1 2 下一页

33) Transfer Object pattern
摘要:类别: 问题: 方案: 示例: package cn.zno; import java.util.ArrayList; import java.util.List; public class TransferObjectPatternDemo { public static void main(St 阅读全文

posted @ 2023-06-16 16:58 zno2 阅读(27) 评论(0) 推荐(0)

32) service locator design pattern
摘要:类别: 问题: 方案: 示例: import java.util.ArrayList; import java.util.List; public class ServiceLocatorPatternDemo { public static void main(String[] args) { S 阅读全文

posted @ 2023-06-16 16:57 zno2 阅读(25) 评论(0) 推荐(0)

31) intercepting filter design pattern
摘要:类别: 问题: 方案: 示例: import java.util.ArrayList; import java.util.List; public class InterceptingFilterPatternDemo { public static void main(String[] args) 阅读全文

posted @ 2023-06-16 16:57 zno2 阅读(23) 评论(0) 推荐(0)

30) front controller design pattern
摘要:类别: 问题: 方案: 示例: public class FrontControllerPatternDemo { public static void main(String[] args) { FrontController frontController = new FrontControll 阅读全文

posted @ 2023-06-16 16:57 zno2 阅读(30) 评论(0) 推荐(0)

29) Data Access Object Pattern
摘要:类别: 问题: 方案: 示例: import java.util.ArrayList; import java.util.List; public class DataAccessObjectPattern { public static void main(String[] args) { Stu 阅读全文

posted @ 2023-06-16 16:57 zno2 阅读(21) 评论(0) 推荐(0)

28) Composite Entity pattern
摘要:类别: 问题: Core J2EE Patterns - Composite Entity http://www.oracle.com/technetwork/java/compositeentity-141992.html 方案: 示例: public class CompositeEntityp 阅读全文

posted @ 2023-06-16 16:57 zno2 阅读(27) 评论(0) 推荐(0)

27) Business Delegate Pattern
摘要:类别: 问题: 方案: public class BusinessDelegatePatternDemo { public static void main(String[] args) { BusinessDelegate businessDelegate = new BusinessDelega 阅读全文

posted @ 2023-06-09 13:38 zno2 阅读(29) 评论(0) 推荐(0)

26) MVC Pattern
摘要:类别: 问题: 方案: 示例: public class MVCPatternDemo { public static void main(String[] args) { // fetch student record based on his roll no from the database 阅读全文

posted @ 2023-06-09 13:37 zno2 阅读(24) 评论(0) 推荐(0)

25) Visitor pattern
摘要:类别: Behavior Pattern visit ['vizit] the act of going to see some person or place or thing for a short time 问题: 方案: 示例: public class VisitorPatternDemo 阅读全文

posted @ 2023-06-09 13:37 zno2 阅读(28) 评论(0) 推荐(0)

24) Template pattern
摘要:类别: Behavior Pattern 问题: 方案: 示例: public class TemplatePatternDemo { public static void main(String[] args) { Game game = new Cricket(); game.play(); S 阅读全文

posted @ 2023-06-09 13:37 zno2 阅读(22) 评论(0) 推荐(0)

23) Strategy pattern
摘要:类别: Behavior Pattern 问题: 方案: 示例: public class StrategyPatternDemo { public static void main(String[] args) { Context context = new Context(new Operati 阅读全文

posted @ 2023-06-09 13:37 zno2 阅读(24) 评论(0) 推荐(0)

22) Null Object pattern
摘要:类别: 问题: 方案: 示例: public class NullObjectPatternDemo { public static void main(String[] args) { Animal animal; animal = getAnimal("cat"); animal.makeSou 阅读全文

posted @ 2023-06-09 13:37 zno2 阅读(23) 评论(0) 推荐(0)

21) State pattern
摘要:类别: Behavioral Pattern 问题: 方案: 示例: public class StatePatternDemo { public static void main(String[] args) { Context context = new Context(); context.f 阅读全文

posted @ 2023-06-09 13:36 zno2 阅读(24) 评论(0) 推荐(0)

20) Observer pattern
摘要:类别: Behavioral Pattern 问题: 方案1: 示例1: import java.util.ArrayList; import java.util.List; public class ObserverPatternDemo { public static void main(Str 阅读全文

posted @ 2023-06-09 13:36 zno2 阅读(34) 评论(0) 推荐(0)

19) Memento pattern
摘要:类别: Behavioral Pattern (备忘录模式) 问题: 方案: 示例: import java.util.ArrayList; import java.util.List; public class MementoPatternDemo { public static void mai 阅读全文

posted @ 2023-06-09 13:36 zno2 阅读(15) 评论(0) 推荐(0)

18) Mediator pattern
摘要:类别: Behavioral Pattern 问题: encapsulate [ɪn'kæpsjʊleɪt] enclose in a capsule or other small container define an object that encapsulates how a set of o 阅读全文

posted @ 2023-06-09 13:36 zno2 阅读(25) 评论(0) 推荐(0)

17) Iterator pattern
摘要:类别: behavioral pattern 问题: Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation. 方案 阅读全文

posted @ 2023-06-09 13:36 zno2 阅读(30) 评论(0) 推荐(0)

16) Interpreter pattern
摘要:类别: behavioral pattern 问题: Polish notation https://en.wikipedia.org/wiki/Polish_notation Abstract syntax tree https://en.wikipedia.org/wiki/Abstract_s 阅读全文

posted @ 2023-06-09 13:36 zno2 阅读(14) 评论(0) 推荐(0)

15) Command pattern
摘要:类别: Behavioral Pattern 问题: 方案: 示例: import java.util.ArrayList; import java.util.List; public class CommandPatternDemo { public static void main(String 阅读全文

posted @ 2023-06-09 13:36 zno2 阅读(24) 评论(0) 推荐(0)

14) chain of responsibility pattern
摘要:类别: behavioral pattern 问题: 高耦合,不灵活 if(){ }else if(){ }else if(){ } ... 方案: 示例: public class ChainOfResponsibilityPattern { public static void main(Str 阅读全文

posted @ 2023-06-09 13:36 zno2 阅读(32) 评论(0) 推荐(0)

1 2 下一页

导航