What is the difference between the Facade and Adap

2019-03-08 00:12发布

I've been reading both definitions and they seem quite the same. Could anyone point out what are their differences?

Thanks

13条回答
爱情/是我丢掉的垃圾
2楼-- · 2019-03-08 00:53

As usual, there exist similarities between several patterns. But I would see it like this:

  • A facade is used to encapsulate an entire layer, and offer some methods to access it "conveniently"
  • An adapter is used, where you have two components that should already work together, but don't, only because of some "unimportant" differences in the interface.
查看更多
登录 后发表回答