|
|
|
It would be very helpful if the BV specification allowed us to configure constraints dynamically.
Consider this simple use case:
{code} @Entity public class Employee { private String _name;
// ...
@Size(min = 1, max = 50) public String getName() { return _name; }
// ... } {code} If some client of mine asked me to change the name of the employees to accept 70 characters because 50 is not enough anymore I have to change my application for all clients. But if the bean validation specification allowed me to configure the constraints dynamically I could do this configuration on a client basis. All I had to do was to change the database structure for the specific column, register this fact in some table of mine and in the application startup my application would check for changes and configure the corresponding bean constraint. With static constraints (as it is today) we don't have this flexibility.
This is just one use case, but I'm sure that there are other situations where this feature is needed as well.
|
|
|
|