grzesiek-galezowski / tdd-ebook

Test-Driven Development - Extensive Tutorial. Open Source ebook
https://leanpub.com/tdd-ebook
Other
361 stars 57 forks source link

Examples with parallel approach. #94

Open mradecki opened 7 years ago

mradecki commented 7 years ago

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.

grzesiek-galezowski commented 7 years ago

Nice comment, I'll see what I can do about it, thanks!