I am writing a daemon running on an embedded platform that needs to change the default route of the device according to which interface it is connecting on at a given time.
I would recommend just using that route command. Thats what it's there for, and anything else will just be a hack.