Hello,
I'm working in VB.Net developing data logging software. I've developed classes implementing a common interface that works with many of the data loggers my company produces. These classes handle the low-level hardware interfacing and expose common methods for accessing the data logger's records.
My issue is what would be a good practice to handle someone suddenly disconnecting the hardware? Should I throw an exception, raise an event, or return false in some sort of status packet?
My basic thought is that I want the object to notify the sender when the device it represents is disconnected and to fail and then somehow communicate to the DeviceLocator class (which auto-detects devices and maintains a collection) that it has been disconnected and to remove it from the collection of devices and dispose.
Any tips?