go-pattern-examples/structure/02_adapter/README.md
2020-04-21 22:53:23 +08:00

8 lines
347 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 适配器模式
适配器模式用于转换一种接口适配另一种接口。
实际使用中Adaptee一般为接口并且使用工厂函数生成实例。
在Adapter中匿名组合Adaptee接口所以Adapter类也拥有SpecificRequest实例方法又因为Go语言中非入侵式接口特征其实Adapter也适配Adaptee接口。