Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 58689 invoked from network); 21 Apr 2004 17:33:45 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 21 Apr 2004 17:33:45 -0000 Received: (qmail 40388 invoked by uid 500); 21 Apr 2004 17:33:28 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 40347 invoked by uid 500); 21 Apr 2004 17:33:28 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: dev@cocoon.apache.org Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 40330 invoked from network); 21 Apr 2004 17:33:27 -0000 Received: from unknown (HELO mail.gmx.net) (213.165.64.20) by daedalus.apache.org with SMTP; 21 Apr 2004 17:33:27 -0000 Received: (qmail 2651 invoked by uid 65534); 21 Apr 2004 17:33:30 -0000 Received: from a183069.studnetz.uni-leipzig.de (EHLO gmx.de) (139.18.183.69) by mail.gmx.net (mp009) with SMTP; 21 Apr 2004 19:33:30 +0200 X-Authenticated: #3483660 Message-ID: <4086B069.1020703@gmx.de> Date: Wed, 21 Apr 2004 19:33:29 +0200 From: Joerg Heinicke User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: de-de, de, en-us, en-gb, en MIME-Version: 1.0 To: dev@cocoon.apache.org Subject: Re: [cforms] refactoring questions (was Re: cvs commit: cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/formmodel Struct.java Messages.java Repeater.java MultiValueField.java AbstractContainerWidget.java Output.java Upload.java Action.java Form.java ContainerDelegate.java AbstractWidget.java Field.java Union.java BooleanField.java Widget.java) References: <20040420221928.11898.qmail@minotaur.apache.org> <4085A446.5050103@outerthought.org> <20040421012425.GE27508@keow.org> <40861558.7020403@outerthought.org> <408660D5.90800@outerthought.org> In-Reply-To: <408660D5.90800@outerthought.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On 21.04.2004 13:53, Marc Portier wrote: > so I'm going for getId on form to return "" (which it was) > and removing getId() == null checks since I favour the NPE here Please not waiting for the NPE somewhere latter in the code for the reasons Ugo pointed out. >>>> 7/ should validation stop as soon as possible or continue to allow >>>> all validation errors to be set? >>> >>> Don't know which is best. *If* we cannot decide (due to different needs >>> in different usecases) then we will need to add an attribute to let the >>> form designer control the behaviour. >> >> hm, we should at least be consistent > > clarifying a bit more: > > we seem to have two distinct cases: > widgets with child-widgets > - i've seen code that doesn't evaluate the parent if one of the kids is > invalid > - but all kids seem to be evaluated even if a previous brother failed > > widgets with validation on definition and widget level > - widget level rules stop evaulation if the definition level was not ok, > and as soon as one of the widget-level validations fails > > I haven't given it much thought yet, if there are clear positions out > there I'm quite happy to just enforce code wise (and add some javadocs > removing any possible future surprise) > > so comments welcome IMO validation should always run on all widgets as it must be possible for the user to get a whole form fixed in one step: http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=107962387820282&w=4 http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=107963156530885&w=4 Joerg