cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From giacomo <giac...@apache.org>
Subject Re: [PROPOSAL] Ref: Bug 7713 - Optional Implicit precondtion checking in matchers
Date Wed, 03 Apr 2002 22:33:22 GMT
On Wed, 3 Apr 2002, Michael Melhem wrote:

<skipped/>

> > <map:act type="let-person-in-if-they-have-session">
> >
> > > 	<map:match pattern="URI1*">
> > > 		...
> > > 	</map:match>
> > >
> > > 	<map:match pattern="URI1*">
> > > 		...
> > > 	</map:match>
> > >
> > > 	...
> >
> > </map:act>
>
> Hi Vadim,
>
> Thanks for your comments. I have not considered wrapping multiple
> match blocks within a single act block like that.
>
> Still, wouldnt the above nest everything one (or more) layer(s) deeper,
> making things less simple?

Depends on the view point. What is less simple? Do you mean less
verbose? Or more implicit?

What does less verbosity or more implicity give? I'd say more confusion
or not exactly knowing what that Matcher does but matching. I think one
thing is matching the other thing is make sure there is a session (SoC).

> Consider the situation where the act block is large and spans more
> than one page?  Wouldn't handling the exception be more difficult in that case
> where if im not mistaken, you would need to ensure any
> matching URI that does not require a session is not within the act
> block.

No I don't think so. It forces you to think about it and group your
matchings according to some higher level concern (session enabled).

> IMHO I think a more scalable solution would be....
>
> 	<!-- session check here would not be a good idea -->
> 	<map:match pattern="login">
> 		<map:parameter name="conditional" value="unConditional"/>
> 		...
> 	</map:match>
>
> 	<map:match pattern="URI1*">
> 		...
> 	</map:match>
>
>
> 	<!-- requires no session check -->
> 	<map:match pattern="simpleLinks-page">
> 		<map:parameter name="conditional" value="unConditional"/>
> 		...
> 	</map:match>
>
> 	<map:match pattern="URI2*">
> 		...
> 	</map:match>

This sample shows that you build up your sitemap for additional URIs you
have to handle simply by putting them at the bottom. This is very
dangerous as you need to group them anyway (from detailed to general).

To be honest. I don't like parametrizable Matchers as this confuses
their meaning. Parameters do a good job for Generators and Transformer
because these Components are more complex. But a Matcher should be kept
as simple as possible.

Giacomo


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message