Ate Douma wrote:
> To be honest, I'm a bit confused about what you are proposing.
> Without a concrete example and explanation what this rule language
> is/looks like and is supposed to do my gut reaction is this might be
> overkill for what we need.
> I definitely think we need as simple as possible solution using
> conventions and a language commonly known.
> That's why I tried to come up with a jstl/el type of example as its a
> standard and widly known language and the runtime evaluation should be
> easily embeddable.
> Defining or even dynamically loading our own custom language seems a bit
> too far fetched.
> But maybe I simply misunderstood your proposal and is it actually very
> simple, so it would be great if you could provide an example.
>
I haven't really thought that much about how the language should look
like. Now, the problem with your proposal is, that you want to embed the
languange inside a spring bean definition file - which is not possible
by just adding new elements with their own namespace. Of course, one
solution would be to pre-process each spring bean definition file, but
this would require that each and everyone uses a specific xml parser for
this (which does the filtering).
So, my proposal is to keep the conditions out of the spring bean
definition file, and create a simple rule file like (don't quote me on
the used element names, they should just give the idea):
<rules>
<rule id="database">
<when test="${pagemanagment='database'}">
<include src="optional/db-pm.xml"/>
</when>
<otherwise>
<include src="optional/castor-pm.xml"/>
</otherwise>
</rule>
<rule id="wsrp">
<if test="${wsrp.enabled}">
<include src="optional/wsrp-beans.xml"/>
</if>
</rule>
</rules>
This is basically the equivalent of your proposal, with the difference
of using an extra file for the conditions and putting the various
conditional beans in separate files.
Carsten
--
Carsten Ziegeler
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]