Abstractions are wonderful things, that is until they leak. At that point, I tend to wish someone didn’t spare me the low-level details.
Recently, I was tasked with developing a system that continually logs temperature readings from 12 hotplates. The plates’ use an RS232 communication interface, which is very easy to negotiate.
With only those high-level details available, I declared that the logging software would be an “afternoon in n’ out job” and created an appropriate design for the timescale / effort:
- Hard-code the 12 plates’
COM
/ttyS
port identifiers and output paths - Loop through each port/path pair
- Send the
GET_TEMPERATURE
request - Write the response to the output file
Job done.
Port identifiers can change.
Wait, who are you?