Code reuse enhanced by adding getId() to Constraint class