A design-by-contract approach to recover the architectural style from run-time misbehaviour