SOFTWARE ENGINEERING

SOFTWARE DESIGN

DESIGN PATTERNS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Use the Mediator pattern when you can’t reuse a component in a different program because it’s too dependent on other components.
A
True
B
False
C
Either A or B
D
None of the above
Explanation: 

Detailed explanation-1: -According to GoF, mediator pattern intent is: Allows loose coupling by encapsulating the way disparate sets of objects interact and communicate with each other. Allows for the actions of each object set to vary independently of one another.

Detailed explanation-2: -The Mediator pattern centralizes communication between modules where it’s explicitly referenced by these modules. In a sense, this is multidirectional. The Facade pattern, on the other hand, just defines a simpler interface to a module or system but doesn’t add any additional functionality.

Detailed explanation-3: -There is one significant disadvantage to this pattern. Since the Mediator itself often needs to be very intimate with all the different classes, it can become extremely complex. This can make it difficult to maintain.

There is 1 question to complete.