i know facade pattern used provide simpler interface hiding complex subsystem interactions.
i referring below wikipedia uml on facade pattern:
are communications/calls facade uni-directional requests i.e., client1/client2 sends request , receive response facade, facade can't initiate request client1/client2 ?
am correct in saying facade provides uni-directional (client -> facade) request interactions (by simpler interface) mediator facilitates bidirectional (client <-> mediator) interactions across systems/classes ?
can provide reference stresses on point ?
yes, correct on both counts. here pertinent quote, directly gof book, page 282 (emphasis mine).
facade differs mediator in abstracts subsystem of objects provide more convenient interface. its protocol unidirectional; is, facade objects make requests of subsystem classes not vice versa. in contrast, mediator enables cooperative behavior colleague objects don't or can't provide, and protocol multidirectional.
also note facade classified structural pattern, whereas mediator behavioral pattern. if facade initiate requests, make behavioral.
Comments
Post a Comment