portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carsten Ziegeler <cziege...@apache.org>
Subject Re: [RT] Spring Configuation
Date Sun, 23 Dec 2007 16:22:20 GMT
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
cziegeler@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message