Return-Path: Delivered-To: apmail-incubator-bval-user-archive@minotaur.apache.org Received: (qmail 20155 invoked from network); 24 Jun 2010 18:47:59 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 24 Jun 2010 18:47:59 -0000 Received: (qmail 94322 invoked by uid 500); 24 Jun 2010 18:47:59 -0000 Delivered-To: apmail-incubator-bval-user-archive@incubator.apache.org Received: (qmail 94292 invoked by uid 500); 24 Jun 2010 18:47:58 -0000 Mailing-List: contact bval-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: bval-user@incubator.apache.org Delivered-To: mailing list bval-user@incubator.apache.org Received: (qmail 94284 invoked by uid 99); 24 Jun 2010 18:47:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Jun 2010 18:47:58 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gudnabrsam@gmail.com designates 209.85.161.175 as permitted sender) Received: from [209.85.161.175] (HELO mail-gx0-f175.google.com) (209.85.161.175) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Jun 2010 18:47:49 +0000 Received: by gxk19 with SMTP id 19so3651725gxk.6 for ; Thu, 24 Jun 2010 11:47:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:content-type :content-transfer-encoding:subject:date:message-id:to:mime-version :x-mailer; bh=UXWgquHfYgTtogZB9RPp/nj3xUK0alhAfv2soNhIpkk=; b=MG8bpNLzesmdMcee4+Ba4xFpgCQjcLkzrAGbi60YHxXaWKEnBw2FUMo5pTIZXpQolM WAwp+2aBf5G8AprMnUsTXEAf5mTt5aR+7KjYeP+VYjwp/jMSCYJdYY+2bEqNNDvjQl3p 5Ta2+rmF+Q9Hu5MkxNO/oqdYEdlqOlNi0bS2s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:content-type:content-transfer-encoding:subject:date:message-id :to:mime-version:x-mailer; b=s2F//hDOg89tLgyZbm+R9MSJbN1zW+t95O5aqLrMyN2Hr69h9guZs6zRlJ7M1kvoPw Pg5w3SvWe9wNCzz9jZ1ItuEnxNgIPeWSLLOR4ov/vqlnodMpXTAMHPWQmi/QeyoAyd8s 8o5E88R0GOEvmxoKhyJDHlRy5Y3S4uxVhOPhQ= Received: by 10.151.88.8 with SMTP id q8mr8857388ybl.67.1277405248460; Thu, 24 Jun 2010 11:47:28 -0700 (PDT) Received: from [192.168.1.13] (adsl-068-213-090-227.sip.bhm.bellsouth.net [68.213.90.227]) by mx.google.com with ESMTPS id p4sm1469526ybk.13.2010.06.24.11.47.27 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 24 Jun 2010 11:47:28 -0700 (PDT) From: Matt Benson Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: Dynamically applied constraints Date: Thu, 24 Jun 2010 13:47:25 -0500 Message-Id: <159838D8-A0B7-41CD-A2FC-E86B70EBA9E4@gmail.com> To: bval-user@incubator.apache.org Mime-Version: 1.0 (Apple Message framework v1081) X-Mailer: Apple Mail (2.1081) X-Virus-Checked: Checked by ClamAV on apache.org Hello all-- I'm just getting my feet wet with JSR-303. I started out using = hibernate-validator, but as a foundation member and general connoisseur = of Apache Kool-Aid I thought the very least I could do is give bval a = fair shake. So far, just browsing code and javadocs--my typical way of = acquainting myself with an OSS project--I'm impressed, FWIW. What I want to do is expose all my validation information to my = controller/view layers per the standard APIs, and here's the catch: = *including* business-level validations which can be extremely dynamic in = nature. To be more explicit, I am in the insurance industry, which (in = the US anyway) consists pretty much entirely of "special cases." Firstly, is this considered out of scope of "Bean Validation" (the = spec)? bval? If so, why?--It's my feeling that the spec intends that = "validation" be quite an open-ended concept. A blanket "don't do this" = would simply make me question the overall usefulness of the spec. = However, it's obvious (at least, I *think* it is) that neither the = annotation-based nor XML-based configuration methods can handle the = dynamic application of constraints to a model. At the same time I want = to be able to use those configuration methods for the subset of = validations that *can* be handled so globally. I am thinking that I can reuse some of the underlying APIs from one of = the existing Bean Validation implementations to maintain this dynamic = information, then implement the ConstraintValidator for an e.g. = @DynamicValidation annotation to reuse others' machinery. *This* I = could configure in XML; best of both worlds. So to put this into bval = terms, I could maintain a MetaBean graph for each distinct model graph = and dynamically apply constraints per graph. This email has written itself in the sense that writing down my thoughts = led to numerous edits and sculpted the above-outlined approach, which = I'm tentatively feeling pretty good about, but I'd still like to get = preliminary feedback from the community on the oh-shit level of the task = I'm setting myself. Regards, Matt=