Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 29662 invoked from network); 17 Jul 2007 13:44:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Jul 2007 13:44:54 -0000 Received: (qmail 36982 invoked by uid 500); 17 Jul 2007 11:55:35 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 36918 invoked by uid 500); 17 Jul 2007 11:55:35 -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 36907 invoked by uid 99); 17 Jul 2007 11:55:35 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jul 2007 04:55:35 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [130.237.222.182] (HELO smtp.nada.kth.se) (130.237.222.182) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jul 2007 04:55:32 -0700 X-Authentication-Info: The sender was authenticated as danielf using PLAIN at smtp.nada.kth.se Received: from [192.168.105.137] ([62.84.203.102]) (authenticated bits=0) by smtp.nada.kth.se (8.12.11.20060308/8.12.11) with ESMTP id l6HBtAEk018632 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 17 Jul 2007 13:55:10 +0200 (MEST) Message-ID: <469CAE19.80102@nada.kth.se> Date: Tue, 17 Jul 2007 13:55:05 +0200 From: Daniel Fagerstrom User-Agent: Thunderbird 1.5.0.12 (Windows/20070509) MIME-Version: 1.0 To: dev@cocoon.apache.org Subject: Re: Clarification on converter concept References: <468AA7E9.7020902@tuffmail.com> <468AC988.60809@gmx.de> <468C2397.9060105@apache.org> <468F2540.2070109@gmx.de> <468FAE5E.6060509@nada.kth.se> <46954DEE.8040401@gmx.de> <46992A2A.50903@nada.kth.se> <469BBFE7.30007@gmx.de> In-Reply-To: <469BBFE7.30007@gmx.de> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Joerg Heinicke skrev: > On 14.07.2007 15:55, Daniel Fagerstrom wrote: ... >>> Doesn't this variant selection go very much into the direction of >>> assumption about the data type? >> It is up to the user. The user could as an example have a "short" >> variant for the short form of a couple of different data types. > This argument is a bit lousy, isn't it? ;-) I don't see that an assumption about what kind of concept you are accessing should be a problem, but we should definitively avoid low level assumptions. As an example: I don't see any problem with letting the template author knowing that something is a date, and optionally make it possible to chose between different visual presentations. But the template author should not need to be aware about differences between java.sql.Date, java.util.Date and a custom date type. >>> It also completely decouples the object-to-string conversion from >>> the templating while with the "select a variant"-approach in the >>> template the conversion can not be done without the template. >> >> That is an implementation detail. We have an object model that an >> expression language can be applied on where the result in turn can be >> converted by a converter and the result in turn can be used in a >> template. We have 4 different parts that can be used both together >> and in parts if implemented in the right way. > > For me it's 1. object model, 2. object-to-string conversion and 3. > referencing the value in the template via the EL. If the EL influences > the conversion 2. and 3. are coupled. That's not just an > implementation detail. No, the object to string conversion is done on the result from the EL, not the other way around. The "#variant" is not part of the EL, it is part of a separate "converter language". ... /Daniel