Return-Path: X-Original-To: apmail-camel-dev-archive@www.apache.org Delivered-To: apmail-camel-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 C11DC9997 for ; Mon, 14 Nov 2011 12:11:01 +0000 (UTC) Received: (qmail 23991 invoked by uid 500); 14 Nov 2011 12:11:01 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 23955 invoked by uid 500); 14 Nov 2011 12:11:01 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 23932 invoked by uid 99); 14 Nov 2011 12:10:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Nov 2011 12:10:59 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of claus.ibsen@gmail.com designates 209.85.215.173 as permitted sender) Received: from [209.85.215.173] (HELO mail-ey0-f173.google.com) (209.85.215.173) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Nov 2011 12:10:55 +0000 Received: by eyh6 with SMTP id 6so5355997eyh.32 for ; Mon, 14 Nov 2011 04:10:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; bh=PbmZnmw7o5YhS2RxcfmEDR509IKVI78ZTBzeiOMuUuI=; b=Fr7GhSxLuc15RbaYSvFk4P8BpmeVCjMc9XwAT991YT6eSZ5TczNUJwYRlNzzNftMdT bOEtPl/bXzrBB/fRXeuhCbsdyIGbN0MY6JTQ/6PuJ6cSXSCiaDTXdao5AQ6uER+8KM/H xtKYiVRj7zycJsjQz0jHNZJzjoEGuI3ZQTyfo= Received: by 10.14.16.223 with SMTP id h71mr1774963eeh.131.1321272634238; Mon, 14 Nov 2011 04:10:34 -0800 (PST) MIME-Version: 1.0 Received: by 10.14.99.5 with HTTP; Mon, 14 Nov 2011 04:10:12 -0800 (PST) From: Claus Ibsen Date: Mon, 14 Nov 2011 13:10:12 +0100 Message-ID: Subject: [DISCUSS] - Fix 2 pain issues with camel-bindy for Camel 2.9 To: dev Content-Type: text/plain; charset=ISO-8859-1 Hi There are two pain issues I see we have with camel-bindy that I would like to address. However as at least 1 of them is non backwards compatible, we have previously targeted that for Camel 3.0. But that was back in the start of the year when Camel 3.0 was more around the corner. Now that Camel 2.9 is a sort of big release I would suggest to move the following two improvements forward to be fixed for Camel 2.9.0. 1) The bindy data format, requires you to define a package name, where bindy will then scan recursively in the package for any bindy model classes (eg annotated with eg @CsvRecord etc.). The problem is that this doesn't work well as you cannot have 2+ model classes in the same package + sub packages. As you cannot explicit define that you marshal to XXX class. So I suggest to remove the package name, and mandate the end user to specify a class type For example to marshal to a Car class .marshal().bindy(Car.class) Then you can have 2+ model in the same package, .marshal().bindy(Train.class) .marshal().bindy(Plane.class) 2) The output of the unmarshal operation is also confusing, as its a List> The List is okay as that would be an entry for each entry. However the Map represents a row. So I suggest to make it simpler and what end users would expect List Where T is the class type, such as List, List etc. For example from an unit test where my T is WheatherModel I need this ugly code Map map = (Map) mock.getReceivedExchanges().get(0).getIn().getBody(List.class).get(0); WeatherModel model = (WeatherModel) map.values().iterator().next(); assertEquals(123, model.getId()); assertEquals("Wednesday November 9 2011", model.getDate()); assertEquals("Central California", model.getPlace()); Instead of just WeatherModel model = (WeatherModel) mock.getReceivedExchanges().get(0).getIn().getBody(List.class).get(0); We have a number of JIRA tickets and end users mailings on the @user about issues with Bindy. I think if we address these 1+2 here we solve the two major pain points people have when getting started with Bindy. -- Claus Ibsen ----------------- FuseSource Email: cibsen@fusesource.com Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/