The constraint validation and cleansing design pattern