What is the difference between the Facade and Adapter Pattern?

后端 未结 16 919
孤城傲影
孤城傲影 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:40

    I've been reading both definitions and they seem quite the same.

    Really ?

    I have noticed that the term Adapter is sometimes used to describe what is in fact a Stategy, maybe because the word is more expressive.

    For example, in Zend Framework, all the Adapter classes are in fact implementations of the Strategy pattern, because they only wrap native code behind classes, to have several behaviours.

    Adapters are often used to wrap legacy or "old-style" code.

提交回复
热议问题