zno2

2023年6月9日 #

27) Business Delegate Pattern

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

posted @ 2023-06-09 13:38 zno2 阅读(10) 评论(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 阅读(5) 评论(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 阅读(6) 评论(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 阅读(4) 评论(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 阅读(4) 评论(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 阅读(7) 评论(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 阅读(7) 评论(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 阅读(11) 评论(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 阅读(8) 评论(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 阅读(5) 评论(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 阅读(7) 评论(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 阅读(6) 评论(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 阅读(4) 评论(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 阅读(7) 评论(0) 推荐(0) 编辑

13) Proxy Pattern

摘要: 类别: Structural Pattern 问题: 操纵一个对象时碍手碍脚,与装饰者模式不同之处: 装饰者是接口方法,授权小 代理则是整个类,授权大 方案: 示例: public class ProxyPatternDemo { public static void main(final Stri 阅读全文

posted @ 2023-06-09 13:35 zno2 阅读(16) 评论(0) 推荐(0) 编辑

12) Flyweight Pattern

摘要: 类别: Structural Pattern 问题/动机: 假若绿色是相同部分,占用1M内存 ,如果提取出来,众对象共享其内容,只占1M内存 ,否则占10M ,且随着对象增多,占用越来越多内存 ,无疑是浪费资源 A flyweight is an object that minimizes memo 阅读全文

posted @ 2023-06-09 13:35 zno2 阅读(7) 评论(0) 推荐(0) 编辑

11) Facade Pattern

摘要: 类别: Structural Pattern 问题/动机: 系统非常复杂 隐藏复杂细节,提供简单界面 方案: 示例: /* Complex parts */ public class FacadePatternDemo { public static void main(String[] args) 阅读全文

posted @ 2023-06-09 13:35 zno2 阅读(11) 评论(0) 推荐(0) 编辑

序) 设计模式参考资料

摘要: https://sourcemaking.com/design_patterns http://javapapers.com/design-patterns/ Design Patterns In software engineering, a design pattern is a general 阅读全文

posted @ 2023-06-09 13:35 zno2 阅读(7) 评论(0) 推荐(0) 编辑

小程序获取手机号

摘要: https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getPhoneNumber.html 从基础库 2.21.2 开始,对获取手机号的接口进行了安全升级,以下是新版本接口使用指南。(旧版本接口目前可以继续使 阅读全文

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

小程序后端服务上线如何配置

摘要: https://developers.weixin.qq.com/miniprogram/dev/framework/ability/network.html 两种模式:一:无端口(即默认端口443,但是请求时不能带端口) 二:有端口(即便是默认443,也要带着) 阅读全文

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

导航