I think it is useful to have this kind of utility classes. I think in this way you can seperate the logic from from different classes more easily. I think the name of the function should be apply and it can be inherited from a list, such that add_constraint and get_constraints functions would be useless.