What is the difference between the Facade and Adapter Pattern?

后端 未结 16 918
孤城傲影
孤城傲影 2021-01-29 23:50

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

Thanks

16条回答
  •  南方客
    南方客 (楼主)
    2021-01-30 00:18

    Adapter pattern allows two,previously incompatible, interfaces to work with each other. Has 2 separate interfaces in play.

    The Facade pattern takes a known interface, that is low level/fine grained, and wraps it with a higher level/course grained interface. Has a single interface, that has been simplified by wrapping with another.

提交回复
热议问题