Return-Path: Delivered-To: apmail-incubator-click-dev-archive@minotaur.apache.org Received: (qmail 78157 invoked from network); 26 Jun 2009 23:22:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 26 Jun 2009 23:22:37 -0000 Received: (qmail 43700 invoked by uid 500); 26 Jun 2009 23:22:48 -0000 Delivered-To: apmail-incubator-click-dev-archive@incubator.apache.org Received: (qmail 43664 invoked by uid 500); 26 Jun 2009 23:22:48 -0000 Mailing-List: contact click-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: click-dev@incubator.apache.org Delivered-To: mailing list click-dev@incubator.apache.org Received: (qmail 43656 invoked by uid 99); 26 Jun 2009 23:22:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Jun 2009 23:22:48 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of malcolm.edgar@gmail.com designates 74.125.92.145 as permitted sender) Received: from [74.125.92.145] (HELO qw-out-1920.google.com) (74.125.92.145) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Jun 2009 23:22:38 +0000 Received: by qw-out-1920.google.com with SMTP id 5so1245187qwf.54 for ; Fri, 26 Jun 2009 16:22:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=c+I22jHfjetCi4ug2mqicba2TDUxBRjtpTev6CTiDOI=; b=FbtWaqs/VN8MZalqsouXBSUUdyc//s0TfB2hEURC41Si0tgiXFMw82OZQKL0jy1nBA z5+HSRSOwBrYY9X9mz4IXPT4Rxtd+wFw7mpjtht/xXrDI/MQolNXrjv9Dt8XCWmRbODS J/jBSxsc4k74aZ7utVdx72lMJYZc8ME0aIGYA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=uko457OR/YmFIPH1v7FhzjpYP7iBBfWoiCjekgrk8wPV4hW2YIDgPdFAd06G/IIP9K sW3DsoNwNsbMxJlSXwYwr0eZcatUaeWnApqJRgNiSFtPOc7dng70TqZk3YpCIg3LsCTM h0dPDX76dfJzSpOVkzqWxJKI+voh+vcR6osPk= MIME-Version: 1.0 Received: by 10.220.85.81 with SMTP id n17mr3388343vcl.54.1246058537735; Fri, 26 Jun 2009 16:22:17 -0700 (PDT) In-Reply-To: <1245989228698-3159580.post@n2.nabble.com> References: <4A43B1A7.7050306@gmail.com> <1245989228698-3159580.post@n2.nabble.com> Date: Sat, 27 Jun 2009 09:22:17 +1000 Message-ID: <525d8e10906261622i48359cc2wfd0d02dfd74eb385@mail.gmail.com> Subject: Re: Method chaining revisited From: Malcolm Edgar To: click-dev@incubator.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org This is a topic I wanted to raise for 2.2 is introducing a builder/factory capability in Click. We have used this in projects and it greatly number of lines of code. Personally I think this is a better approach than method chaining. I will u pload some builder/factory patterns later today. regards Malcolm Edgar On Fri, Jun 26, 2009 at 2:07 PM, florin.g wrote: > > I'm a fan > > > > sabob wrote: >> >> Its been suggested before to add method chaining to Click controls. >> >> With Java5 support of Covariant return types, I'd like to revisit this >> feature. It would allow us to write the following: >> >> =A0 =A0form.add(new TextField("name").required(true).width("200px")); >> >> instead of: >> >> =A0 =A0TextField field =3D new TextField("name"); >> =A0 =A0field.setRequired(true); >> =A0 =A0field.setWidth("200px"); >> =A0 =A0form.add(field); >> >> >> I think Field and Column would get the most benefit from such a change. >> >> Couple of issues are API bloat, which is why I'd like to limit this to >> =A0 only a couple of controls. The other issue is NPE but that shouldn't >> be a problem because a reference to the Control instance is always >> returned. >> >> Thoughts? >> >> bob >> >> > > -- > View this message in context: http://n2.nabble.com/Method-chaining-revisi= ted-tp3156429p3159580.html > Sent from the click-development mailing list archive at Nabble.com. > >