tdd-ebook
tdd-ebook copied to clipboard
Examples with parallel approach.
Regarding fragment:
broadcastingObserver = ParallelBroadcastObserver(
DisplayingObserver(),
StoringObserver(),
CalculatingObserver())
sensor.FromNowOnReportTo(broadcastingObserver)
This is really cool concept. I just think it fits more in example about lifts. Being parallel while calling handlers for two values does not relly convince me, while being sequential with lowering lifts during fire alarm seems just crazy. For example:
var alarm
= new ParallelAlarm(
new AutoLift(),
new MechanicalLift(),
new ModernLift());
Now we can imagine that all lifts are handled parallely which should be expected in case of fire.
Nice comment, I'll see what I can do about it, thanks!