[hibernate-dev] Re: [BV] Support for constraints by groups
Hardy Ferentschik
hibernate at ferentschik.de
Wed May 27 09:41:32 EDT 2009
On Tue, 26 May 2009 16:57:11 +0200, Emmanuel Bernard
<emmanuel at hibernate.org> wrote:
>> # background
>> When validating a specific group(s), Bean Validation expends the
>> group into a sequence of groups to be validated (because a group can
>> be a group sequence really). Depending on how clever the
>> implementation is, it could sequencialize all group execution or try
>> to validate several non sequenced group in parallel.
We are already doing the sequencialize part. In our case we are populating
a 'GroupChain'
object, but the idea is the same. However, this sequencializing is really
independent
from the defined constraints. One can determine the group execution order
without actually
evaluating the entities. I think group sequencialize and actual validation
are orthogonal
and should stay this way.
I am also not sure why we should add
validator.getConstraintsForClassAndGroups to the Validator
interface? The Validator interface is the main contract between Bean
Validation and a client.
It allows to either validate an object or get some meta information. The
latter is probably mainly
used for tooling. Where would validator.getConstraintsForClassAndGroups
fit into this?
Why would we expose this call to a client?
--Hardy
More information about the hibernate-dev
mailing list