object oriented analysis - Mediator Pattern with Non colleague classes -


i have read mediator pattern , idea clear me. however, 1 thing struck mind code mediator pattern becomes easier use colleague classes in mediator. is, objects want communicate derive same base class. however, in lot of scenarios need similar kind of communication several objects involved, not colleagues. mediator still way go, or there better approach ? thanks!

the mediator pattern defines object encapsulates how set of objects interact. here colleagues how wants communicate accomplish task. colleagues need not having similar responsibilities. therefore absolutely fine if go mediator pattern.

but remember colleague class should have responsibility pass message sake of communication , nothing else.


Comments

Popular posts from this blog

searchKeyword not working in AngularJS filter -

sequelize.js - Sequelize: sort by enum cases -

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -