Working on a WPF application, I had a requirement to allow a
user to monitor the status of a number of connected services – the status of some
services could fluctuate many times per second.
There were a couple of issues that needed to be considered:
- How would I get
hold of these monitored ‘services’? Could
I just create new instances and pass them into my monitoring class? Unfortunately not, as I didn’t know until
runtime what these services were.
- How would I throttle the status updates to make them more
presentable to the user without resulting in some sort of flashing Christmas tree
effect?
- How would I unit test the monitoring behaviour?
- How would I display the status of specific items in an easy to understand manner? Did I want to wait for a disconnect status and show that in, say, red?