简体   繁体   中英

Mediator pattern when having multiple instances of mediator

This is a business scenario of an examination question, and I'm supposed to use the mediator pattern to design it.

TradeMe is a famous online system for trading goods. People can buy and sell goods online using TradeMe. A common strategy to buy goods from sellers for cheaper prices is collective bargaining. In this strategy, a set of buyers collaborate and make offers to a good. These offers are well below the seller‟s expected price for the good, but since the seller does not get any higher offer for the good, he has to sell it to a much lower price than he originally expected. For this collective bargaining strategy to work, a buyer must notify all the other buyers involved in the strategy about the price he is going to offer to the seller. Any information a buyer received from a seller should also be communicated to others involved in the strategy.

From what i researched in the internet, mediator pattern can be implemented when objects are created with a mediator object in it, so they can call it directly. But in this scenario there can be many mediators but the same objects being used.

What is the best approach here?

我认为这将违反拍卖网站TradeMe的规则。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM