Binb's Blog
  • 🔍搜索
  • 🏠 主页
  • ⏱️ 时间轴
  • 📚 文章
  • 🔖 标签
  • GitHub 
🏠 主页 » 

设计模式

开篇

写在前面 这个专栏记录学习设计模式的一些笔记,相关代码在GitHub上 面向对象基础 字段和属性 变量私有的叫字段,公有的是属性,那么对于方法而言,...

2021-09-14    2199字    5分钟    chance7bin    设计模式

创建型模式

简单工厂模式——计算器 结构图 简单工厂模式实现 运算接口(父类) 1 2 3 public interface IOperation { double getResult(double a, double b); } 创建两个运算符类实现该接口 1 2 3 4 5 6 7 8 public class AddOperation implements IOperation {...

2021-09-14    6852字    14分钟    chance7bin    设计模式

结构型模式

适配器模式——翻译、DataAdapter 适配器模式(Adapter),将一个类的接口转换成客户希望的另外一个接口。Adapter模式使得原...

2021-09-14    6265字    13分钟    chance7bin    设计模式

行为模式

职责链模式——加薪 职责链模式(Chain of Responsibility):使多个对象都有机会处理请求,从而避免请求的发送者和接收者之间的耦合...

2021-09-14    7132字    15分钟    chance7bin    设计模式
© 2023 Binb's Blog Powered by Hugo & PaperMod