摘要: 一、享元模式介绍 二、享元模式引入 需求: 传统方式: 享元模式: 代码实现(Java): public class User { private String name; public User(String name) { super(); this.name = name; } public 阅读全文
posted @ 2021-07-06 22:21 狂热搬砖家 阅读(43) 评论(0) 推荐(0)
摘要: 一、外观模式介绍 二、外观模式引入 需求: 传统方式: 外观模式: UML类图: 代码实现(Java): //剧场 public class TheaterLight { private static TheaterLight instance = new TheaterLight(); publi 阅读全文
posted @ 2021-07-06 19:14 狂热搬砖家 阅读(43) 评论(0) 推荐(0)