Façade vs. Mediator

后端 未结 8 1396
粉色の甜心
粉色の甜心 2020-12-07 08:46

I\'ve been researching the difference between these two patterns.

I understand that facade encapsulates access to a sub system and mediator encapsulates the interac

8条回答
  •  情歌与酒
    2020-12-07 09:19

    under related patterns, gof says: Facade (185) differs from Mediator in that it abstracts a subsystem of objects to provide a more convenient interface. Its protocol is unidirectional; that is, Facade objects make requests of the subsystem classes but not vice versa. In contrast, Mediator enables cooperative behavior that colleague objects don't or can't provide, and the protocol is multidirectional.

提交回复
热议问题