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 Fri, 13 Jul 2007 20:39:14 GMT
Grzegorz Kossakowski <gkossakowski <at> apache.org> writes:

> >> Yes, there is still a registry but neither EL user nor EL 
> >> implementation must care about it.
> > 
> > This looks like a registry for expression languages, not for converters. 
> > How is it related?
> 
> I mentioned that snippet as an example how registry could work; my aim was to
> show that we use declarative approach instead of registering converters/
> property editors manually.

Ah, got it. :-) Though the names are a bit irritating. Aren't the
ExpressionCompilers actually the factories and isn't the ExpressionFactory more
of a registry? It's also a bit strange that the Expressions must be aware of the
prefix they are mapped to (Expression.getLanguage() + constructors of
implementations). Any reason for that?

Something similar exists for the PropertyEditors, the PropertyEditorRegistrar
[1]. You are only supposed to implement it yourself which more or less means to
add the PropertyEditors programmatically. Since I did not want to do this, I
wrote a MapBasedPropertyEditorRegistrar (matching more or less
DefaultExpressionFactory) which I could at least configure from Spring.
spring-configurator's BeanMap seems to go one step further and searches for all
implementations of a particular interface in the application context.

Joerg

[1] http://static.springframework.org/spring/docs/2.0.x/api/
org/springframework/beans/PropertyEditorRegistrar.html


Mime
View raw message