honeytrap.devexercisesmediator.javaSettings
Description

20. Mediator

MediumBehavioural1 hidden requirement

Routing through one place, so nobody has to hold a reference to everybody

A member says something and everyone else hears it. The tests pass.

Each member keeps its own list of the others and delivers to them directly. With two people that is two references; with ten it is ninety, and every one of them is wiring somebody has to remember to do.

Every member is already in the room, and ChatRoom.say() knows who is there. Rewrite say() to go through the room.

Run compiles every file and runs Tests.java — the tests you can read.

Submit runs those again, then applies 1 requirement you have not seen, one at a time.

Your code is never edited. Each requirement is added to the project as it stands. If the design is right, nothing you wrote has to change.

  • Ctrl/⌘ + Enter runs the tests