Hi Although i know what i'm doing, as i haven't got much experience i thought it would be good to get other peoples views. I'm writing a commercial program that will drive and read from external hardware, including a servo motor, LVDT units, and a PLC. There seems to be alot of complexity because of the hardware. Because of this, i'm using a state pattern, to drive my software. My notes from uni have allerted me to the necessity of making a program 'robust', and able to 'take whatever is thrown at it', and 'gracefully recover'. I get the impression that this means i should be considering all kinds of possible unexpected situations, or exceptions. For example, a user might pull out a lead, and, i was thinking, my program should detect this if possible and report. eg if the PLC lead is not plugged in, the program should report with an error message like 'check your plc line' etc. At the very least the program should not end up in a non-usable state, but the user should be able to interact and get it moving again. Am I going about this correctly, thinking through all kinds of possible exceptions and making sure the program wont end up in a non usable state? Perhaps someone who has done these kinds of programs (programs interacting with hardware) may have something useful to share? It's my first commercial program, and there is no one to get expert advice from.
thanks Gavran