cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject Re: Clarification on converter concept
Date Mon, 16 Jul 2007 18:58:47 GMT
On 14.07.2007 15:55, Daniel Fagerstrom wrote:

> The main difference in my view is that with paths the choice of 
> presentation is connected to the model and with anchors it is connected 
> to the presentation.

Ok, I agree.

> Both cases have legitimate uses. A particular date could be presented 
> both in its short form in a table and in its long form in a text. That 
> is clearly a presentation issue.

I'd really like to involve Spring guys here. I'm interested how they 
think this can be solved.

>> 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? ;-)

>> 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.

> Further, using an EL and format variants on a bean model would 
> probably be possible for a web designer. Writing Spring bean 
> configurations seem to be a little bit to much.

I agree that the different date representations are presentation issues, 
not model issue. I don't have any solution for it except those variants.

> Also if you have e.g. a regexp defined format, will you need to repeat 
> it for each property path you would like to apply it on?

You don't need to. Similar to the setup of the "short" variant you can 
set up the regexp-defined editor. You only would need to reference it 
multiple times in the bean definition as shown with my 
MapBasedPropertyEditorRegistrar sample [1]. That's similar to 
referencing "short" in the EL.

>> There is indeed no way to select a converter based on the locale at 
>> the moment.
> 
> To me this sounds like Spring doesn't have a satisfying solution to the 
> locale problem right now.

Didn't I confirm this already? :-)

That's the second thing I'd like to get Spring community involved.

Joerg

[1] http://marc.info/?l=xml-cocoon-dev&m=118438238711044&w=4


Mime
View raw message