This website works better with JavaScript.
Explore
Help
Register
Sign In
liangqi
/
pattern
Watch
1
Star
0
Fork
You've already forked pattern
0
Code
Issues
Pull Requests
Projects
Releases
Wiki
Activity
设计模式(java源码实现)
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
86
Commits
1
Branch
0
Tags
208 KiB
Java
100%
Tag:
Branch:
Tree:
master
master
Branches
Tags
${ item.name }
Create tag
${ searchTerm }
Create branch
${ searchTerm }
from 'master'
${ noResults }
pattern
/
pattern-adapter
/
README.md
366 B
Raw
Permalink
Blame
History
适配器模式
模型:结构模型
思想:
适配器模式有两种实现方式:继承和委托
适配器模式把一个类的接口变换成客户端所期待的另一种接口,从而使原本因接口不匹配而无法在一起工作的两个类能够在一起工作
好处:
对经过充分测试的现有类,实现复用,减少代码。