04 2021 档案

摘要:委派模式 委派模式结构图: 示例代码: // 抽象任务类 public interface Task { void doTask(); } // 具体任务角色A public class ConcreteTaskA implements Task{ @Override public void doT 阅读全文
posted @ 2021-04-29 22:37 justKen 阅读(78) 评论(0) 推荐(0) 编辑
摘要:解释器模式 解释器模式结构图: 示例代码: // 抽象表达式角色 public interface ArithmeticInterpreter { int interpret(); } // 终结表达式角色 public abstract class Interpreter implements A 阅读全文
posted @ 2021-04-29 00:46 justKen 阅读(45) 评论(0) 推荐(0) 编辑
摘要:状态模式 状态模式结构图: 示例代码: // 抽象状态类 public abstract class Status { protected ApplicationContext context; public void setContext(ApplicationContext context) { 阅读全文
posted @ 2021-04-28 21:54 justKen 阅读(45) 评论(0) 推荐(0) 编辑
摘要:模板方法模式 模板方法模式结构图: 示例代码: // 测试类 public class TemplateMethodTest { public static void main(String[] args) { TemplateMethod method = new ConcreteMethod() 阅读全文
posted @ 2021-04-28 00:02 justKen 阅读(43) 评论(0) 推荐(0) 编辑
摘要:备忘录模式 备忘录模式原型图: 示例代码: // 抽象备忘录接口 public interface Memento { } // 发起人角色 @Data public class Originator { private String status; public Originator(String 阅读全文
posted @ 2021-04-27 08:14 justKen 阅读(45) 评论(0) 推荐(0) 编辑
摘要:原型模式 原型模式结构图: 示例代码: // 具体对象A,浅克隆 @Data public class ConcretePrototypeA implements Cloneable{ private String str; private List<String> list = new Array 阅读全文
posted @ 2021-04-26 23:23 justKen 阅读(26) 评论(0) 推荐(0) 编辑
摘要:命令模式 命令模式结构图: 示例代码: // 命令接受者,负责具体执行命令 public class Receiver { public void action(){ System.out.println("开始执行命令========"); } } // 命令抽象类 public interfac 阅读全文
posted @ 2021-04-25 07:37 justKen 阅读(40) 评论(0) 推荐(0) 编辑
摘要:桥接模式 桥接模式结构图: 示例代码: // 桥接角色Message接口 public interface Message { void sendMessage(String message, String toUser); } // 具体Message角色Email public class Em 阅读全文
posted @ 2021-04-24 23:54 justKen 阅读(64) 评论(0) 推荐(0) 编辑
摘要:适配器模式 适配器模式结构图: 示例代码: // 已有登录类实现 public class PassportService { public String regist(String userName, String password){ System.out.println("注册成功====== 阅读全文
posted @ 2021-04-24 20:40 justKen 阅读(48) 评论(0) 推荐(0) 编辑
摘要:建造者模式 建造者模式结构图: 示例代码: public class BuilderTest { public static void main(String[] args) { ConcreteBuilder builder = new ConcreteBuilder(); Product pro 阅读全文
posted @ 2021-04-22 23:52 justKen 阅读(43) 评论(0) 推荐(0) 编辑
摘要:访问者模式 访问者模式结构图: 示例代码: // 抽象访问者 public interface Visistor { void checkWork(Engineer engineer); void checkWork(Manager manager); } // 具体访问者boss public c 阅读全文
posted @ 2021-04-21 23:39 justKen 阅读(60) 评论(0) 推荐(0) 编辑
摘要:迭代器模式 迭代器模式结构图: 示例代码: // 抽象迭代器 public interface Iterator <E>{ boolean hasNext(); E next(); } // 具体迭代器 public class ConcreteIterator<E> implements Iter 阅读全文
posted @ 2021-04-19 07:34 justKen 阅读(51) 评论(0) 推荐(0) 编辑
摘要:代理模式 代理模式分为静态代理和动态代理.下图为静态代理结构图: 静态代理示例代码: // 抽象主题接口 public interface Subject { void request(); } // 具体主题角色 public class RealSubject implements Subjec 阅读全文
posted @ 2021-04-18 12:16 justKen 阅读(45) 评论(0) 推荐(0) 编辑
摘要:享元模式 享元模式结构图 示例代码 // 抽象享元角色 public interface Flyweight { void doSomething(); } // 具体享元角色 public class ConcreteFlyweight implements Flyweight{ private 阅读全文
posted @ 2021-04-17 17:07 justKen 阅读(41) 评论(0) 推荐(0) 编辑
摘要:组合模式 组合模式分为安全组合模式和透明组合模式,本文下的示例代码为透明组合模式,在叶子节点中冗余实现了叶子节点不需要的方法,而安全组合模式则需要进行叶子节点和普通节点的区分. 组合模式结构图 示例代码 // 抽象类 public abstract class Component { protect 阅读全文
posted @ 2021-04-17 13:47 justKen 阅读(58) 评论(0) 推荐(0) 编辑
摘要:观察者模式 观察者模式结构图 示例代码 // 抽象主题 public abstract class Subject { protected List<Observer> observers = new ArrayList<>(); protected Event event; public bool 阅读全文
posted @ 2021-04-17 11:46 justKen 阅读(38) 评论(0) 推荐(0) 编辑
摘要:### 中介者模式,又称为调停者模式或调解者模式 1.中介者模式结构图 示例代码 // 抽象中介类 public abstract class Mediator { protected ConcreteColleagueA concreteColleagueA; protected Concrete 阅读全文
posted @ 2021-04-16 23:26 justKen 阅读(57) 评论(0) 推荐(0) 编辑
摘要:装饰器模式 装饰器模式结构图 示例代码: // 抽象公共类 public abstract class Component { public abstract void work(); } // 具体被装饰对象 public class People extends Component{ @Over 阅读全文
posted @ 2021-04-16 07:46 justKen 阅读(33) 评论(0) 推荐(0) 编辑
摘要:责任链模式 责任链模式结构图 示例代码: // 抽象处理类 public abstract class Handler { protected Handler nextHandler; public void add(Handler handler){ this.nextHandler = hand 阅读全文
posted @ 2021-04-13 23:57 justKen 阅读(44) 评论(0) 推荐(0) 编辑
摘要:门面模式(外观模式) 门面模式结构图 示例代码: public class FacadeTest { public static void main(String[] args) { Facade facade = new Facade(); facade.doWork(); } // 子系统A s 阅读全文
posted @ 2021-04-12 23:41 justKen 阅读(42) 评论(0) 推荐(0) 编辑
摘要:抽象工厂模式 1.抽象工厂结构图 示例代码: // 抽象工厂类 public abstract class AbstractFactory { protected abstract FoodProduct createProductA(); protected abstract BookProduc 阅读全文
posted @ 2021-04-11 20:01 justKen 阅读(45) 评论(0) 推荐(0) 编辑
摘要:工厂方法模式 工厂方法模式结构图 示例代码: public interface Product { void doSomething(); } public class ProductA implements Product{ @Override public void doSomething() 阅读全文
posted @ 2021-04-11 18:43 justKen 阅读(37) 评论(0) 推荐(0) 编辑
摘要:简单工厂模式 1.简单工厂模式结构图 2.示例代码: public interface Product { void doSomething(); } public class ProductA implements Product{ @Override public void doSomethin 阅读全文
posted @ 2021-04-11 18:41 justKen 阅读(40) 评论(0) 推荐(0) 编辑
摘要:策略模式 1.策略模式结构图: 2.示例代码: 首先是一个策略类的接口或者抽象类,这里创建的是接口: public interface Strategy { void play(); } 接着创建具体的策略类,封装不同的实现算法: public class StrategyA implements 阅读全文
posted @ 2021-04-11 07:52 justKen 阅读(79) 评论(0) 推荐(0) 编辑
摘要:单例模式 应用场景:只需要一个实例,保证一个类仅有一个实例,并提供一个访问它的全局访问点. 这里主要列举以下四种实现方式: (1)饿汉式: public class Singleton01 { public static final Singleton01 SINGLETON = new Singl 阅读全文
posted @ 2021-04-09 23:55 justKen 阅读(48) 评论(0) 推荐(0) 编辑
摘要:## Jmeter下载安装,设置中文,返回值乱码处理,下载接口测试 下载地址 解压后,在Jmeter的bin文件夹下启动 修改默认启动为中文简体:打开bin目录下的jmeter.properties文件,在该文件的第38行左右 #第38行左右有如下行的注释内容: #language=en 在该行下添 阅读全文
posted @ 2021-04-05 20:47 justKen 阅读(53) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示