一.概述 命令模式 二.代码 1.Client.java public class Client { public void request(Server server){ server.addCommand(new TextCommand()); server.addCommand(new ImageCommand()); server.doSomething(); } } 2.Server.java public class Server { private List<Command> c…