Return-Path: X-Original-To: apmail-cocoon-dev-archive@www.apache.org Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CB0FD6520 for ; Wed, 6 Jul 2011 08:47:34 +0000 (UTC) Received: (qmail 2531 invoked by uid 500); 6 Jul 2011 08:47:30 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 2184 invoked by uid 500); 6 Jul 2011 08:47:08 -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 List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 2172 invoked by uid 99); 6 Jul 2011 08:47:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jul 2011 08:47:01 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [82.99.2.81] (HELO mx4.ciber-europe.com) (82.99.2.81) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jul 2011 08:46:53 +0000 Received: from eusex01.sweden.ecsoft ([10.46.0.69]) by mx4.ciber-europe.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 6 Jul 2011 10:46:32 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: question regarding chainability of methods current API Date: Wed, 6 Jul 2011 10:46:32 +0200 Message-ID: <7C655C04B6F59643A1EF66056C0E095EA99D06@eusex01.sweden.ecsoft> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: question regarding chainability of methods current API Thread-Index: Acw7uTRRCAZIn2HIRv+JezxXmo9YkA== From: "Robby Pelssers" To: X-OriginalArrivalTime: 06 Jul 2011 08:46:32.0461 (UTC) FILETIME=[349D3BD0:01CC3BB9] X-Virus-Checked: Checked by ClamAV on apache.org Hi Simone, I have one question to the current interface of Pipeline. I know you = wrote a SAXPipelineBuilder to allow chaining. But it would have been much nicer if the Pipeline interface itself would = have been chainable. void addComponent(T pipelineComponent); --> Pipeline = addComponent(T pipelineComponent); void setup(OutputStream outputStream); --> Pipeline = setup)(OutputStream outputStream); Same for other methods for which it makes sense to chain them. This would allow me to switch from @Test public void testXQuery1() throws Exception { Map parameters =3D new HashMap(); parameters.put("sentence", "split words test"); XQJGenerator generator =3D new = XQJGenerator(this.getClass().getResource("/xquery/stringtest.xquery"));=20 generator.setXQDataSource(xqds); Pipeline pipeline =3D new = NonCachingPipeline(); pipeline.addComponent(generator); pipeline.addComponent(new XMLSerializer().setIndent(true)); pipeline.setup(System.out, parameters); =20 pipeline.execute(); } to=20 @Test public void testXQuery1() throws Exception { Map parameters =3D new HashMap(); parameters.put("sentence", "split words test"); XQJGenerator generator =3D new = XQJGenerator(this.getClass().getResource("/xquery/stringtest.xquery"));=20 generator.setXQDataSource(xqds); Pipeline pipeline =3D=20 new NonCachingPipeline() .addComponent(generator) .addComponent(new XMLSerializer().setIndent(true)) .setup(System.out, parameters) .execute(); } which basically is what you intended to achieve if i'm correct. I know it's quite a big API change but designing the API with = chainability in mind makes sense. Robby