changchangjie / changchangjie.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

设计模式-适配器模式 | Changjie's blog

changchangjie opened this issue · comments

https://changjie.me/2018/10/19/%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F-%E9%80%82%E9%85%8D%E5%99%A8%E6%A8%A1%E5%BC%8F/#more

适配器模式跟代理模式写法上类似。适配器模式做的就是,有一个接口需要实现,但是我们现成的对象都不满足,需要加一层适配器来进行适配。分为对象适配器模式、类适配器模式