You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Michael Melhem <mi...@fztig938.bank.dresdner.net> on 2002/04/03 13:00:34 UTC
[PROPOSAL] Ref: Bug 7713 - Optional Implicit precondtion checking in matchers
Hi everyone,
I trust you all had a good easter break :-)
This is a propasal for the introduction of implicit precondition checking
in matchers. Please refer to Bug 7713 for more information!!
You can find the patch for this proposal as a part of Bug 7713.
Here I outline some of the reasoning for this proposal...
While writing a large c2 based application we have come to the
conclusion that matchers with built-in *implicit* checks would be
desirable.
For Example, instead of using a "valid session checker action"
in *every* single pipeline in the sitemap to secure against clients
who do not have sessions, we simply configure a matcher with a
"session-exists precondition". That way, we simplify sitemap pipelines,
which we find are already too large and complex.
There are several advantages with implicit matcher checking including,
simplified sitemaps, scalablity, easier development with developers
not having to remember to always include certian actions, hiding of
unnecessary and repetitive information, etc
Of course precondition matchers are not useful in every situation,
but are of best advantage when ones finds themselves using the
same general actions in a lot of the sitemap pipelines.
Any comments?
Best Regards,
Michael Melhem
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: [PROPOSAL] Ref: Bug 7713 - Optional Implicit precondtion checking in matchers
Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Michael Melhem [mailto:michaelm@fztig938.bank.dresdner.net]
>
> On Wed, Apr 03, 2002 at 08:05:40AM -0500, Vadim Gritsenko wrote:
...
> > Michael,
> >
> > Have you considered using just one pipeline? Or two (and no more
than
> > two)?
> >
> >
> > > This is not a good thing, especially if you have lots of complex
> > pipelines.
> >
> > Here I fail to see how this is much simpler than using action. Why
not
> > just:
> >
> > ...
> >
> > <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?
This might be just my personal opinion, but I feel that having all
protected resources gathered together in one place under one action is
better than same resources scattered among multiple pipelines and
different parts of the sitemap.
> Consider the situation where the act block is large and spans more
> than one page?
I can easily imagine this. Moreover, I have similar constructs in my
sitemap.
> 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.
I do group all the resources under one act element, as described above.
If you think that multi-page sitemap is not readable, than it is time to
use sub-sitemaps. Collect all protected resources in the sitemap, and
mount it from the main sitemap. You can wrap mount instruction with the
action.
> 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>
BTW, your solution is less performing. One action will be executed once,
skipping all of the matchers, which could sum to noticeable amount of
CPU cycles (especially RE matchers)
> All that this proposal (Bug 7713) does is allow matchers to be more
> configurable, and does not take away any existing functionality.
I'm not sure I like this proposal. At present moment, this looks to me
that instead of solving management issues you have, you are trying to
employ technology to hide these issues deeper.
> thoughts?
Above.
Vadim
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [PROPOSAL] Ref: Bug 7713 - Optional Implicit precondtion checking
in matchers
Posted by giacomo <gi...@apache.org>.
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
Re: [PROPOSAL] Ref: Bug 7713 - Optional Implicit precondtion checking in matchers
Posted by Michael Melhem <mi...@fztig938.bank.dresdner.net>.
On Wed, Apr 03, 2002 at 08:05:40AM -0500, Vadim Gritsenko wrote:
> > From: Michael Melhem [mailto:michaelm@fztig938.bank.dresdner.net]
> >
> > On Wed, Apr 03, 2002 at 01:03:22PM +0100, Stuart Roebuck wrote:
> > >
> > > On Wednesday, April 3, 2002, at 12:00 PM, Michael Melhem wrote:
> > >
> > > >Hi everyone,
> > > >
> > > >I trust you all had a good easter break :-)
> > > >
> > > >This is a propasal for the introduction of implicit precondition
> > > >checking
> > > >in matchers. Please refer to Bug 7713 for more information!!
> > > >You can find the patch for this proposal as a part of Bug 7713.
> > > >
> > > >Here I outline some of the reasoning for this proposal...
> > > >
> > > >While writing a large c2 based application we have come to the
> > > >conclusion that matchers with built-in *implicit* checks would be
> > > >desirable.
> > > >
> > > >For Example, instead of using a "valid session checker action"
> > > >in *every* single pipeline in the sitemap to secure against clients
> > > >who do not have sessions, we simply configure a matcher with a
> > > >"session-exists precondition". That way, we simplify sitemap
> pipelines,
> > > >which we find are already too large and complex.
> > > >
> > > >There are several advantages with implicit matcher checking
> including,
> > > >simplified sitemaps, scalablity, easier development with developers
> > > >not having to remember to always include certian actions, hiding of
> > > >unnecessary and repetitive information, etc
> > > >
> > > >Of course precondition matchers are not useful in every situation,
> > > >but are of best advantage when ones finds themselves using the
> > > >same general actions in a lot of the sitemap pipelines.
> > > >
> > > >Any comments?
> > >
> > > From your description it sounds like existing facility for embedding
> > > match statements might do the trick:
> > >
> > > <map:match pattern="*">
> > > <map:act type="let-the-person-in">
> > >
> > > <map:match pattern="match1">
> > > ...
> > > </map:match>
> > >
> > > <map:match pattern="match2">
> > > ...
> > > </map:match>
> > >
> > > ...
> > > </map:act>
> > > </map:match>
> > >
> > > Stuart.
> >
> > Hi stuart,
> >
> > Thanks for your input.
> >
> > Yes, you are correct, one could *explicitly* use actions and
> > embedded matchers to do the same thing.
> >
> > However when the "map:act type=let-the-person-in" is generic, say
> > "let-the-person-in-if-they-have-a-session", then it would seem to me,
> to
> > make more sense for that check to be done implicitly as part of the
> > match.
> >
> > Otherwise you could clutter your sitemap with
> > <map:act type=let-the-person-in> in almost every pipeline.
>
> Michael,
>
> Have you considered using just one pipeline? Or two (and no more than
> two)?
>
>
> > This is not a good thing, especially if you have lots of complex
> pipelines.
>
> Here I fail to see how this is much simpler than using action. Why not
> just:
>
> ...
>
> <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?
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.
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>
All that this proposal (Bug 7713) does is allow matchers to be more configurable, and
does not take away any existing functionality.
thoughts?
>
>
> Vadim
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>
Best Regards,
Michael Melhem
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: [PROPOSAL] Ref: Bug 7713 - Optional Implicit precondtion checking in matchers
Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Michael Melhem [mailto:michaelm@fztig938.bank.dresdner.net]
>
> On Wed, Apr 03, 2002 at 01:03:22PM +0100, Stuart Roebuck wrote:
> >
> > On Wednesday, April 3, 2002, at 12:00 PM, Michael Melhem wrote:
> >
> > >Hi everyone,
> > >
> > >I trust you all had a good easter break :-)
> > >
> > >This is a propasal for the introduction of implicit precondition
> > >checking
> > >in matchers. Please refer to Bug 7713 for more information!!
> > >You can find the patch for this proposal as a part of Bug 7713.
> > >
> > >Here I outline some of the reasoning for this proposal...
> > >
> > >While writing a large c2 based application we have come to the
> > >conclusion that matchers with built-in *implicit* checks would be
> > >desirable.
> > >
> > >For Example, instead of using a "valid session checker action"
> > >in *every* single pipeline in the sitemap to secure against clients
> > >who do not have sessions, we simply configure a matcher with a
> > >"session-exists precondition". That way, we simplify sitemap
pipelines,
> > >which we find are already too large and complex.
> > >
> > >There are several advantages with implicit matcher checking
including,
> > >simplified sitemaps, scalablity, easier development with developers
> > >not having to remember to always include certian actions, hiding of
> > >unnecessary and repetitive information, etc
> > >
> > >Of course precondition matchers are not useful in every situation,
> > >but are of best advantage when ones finds themselves using the
> > >same general actions in a lot of the sitemap pipelines.
> > >
> > >Any comments?
> >
> > From your description it sounds like existing facility for embedding
> > match statements might do the trick:
> >
> > <map:match pattern="*">
> > <map:act type="let-the-person-in">
> >
> > <map:match pattern="match1">
> > ...
> > </map:match>
> >
> > <map:match pattern="match2">
> > ...
> > </map:match>
> >
> > ...
> > </map:act>
> > </map:match>
> >
> > Stuart.
>
> Hi stuart,
>
> Thanks for your input.
>
> Yes, you are correct, one could *explicitly* use actions and
> embedded matchers to do the same thing.
>
> However when the "map:act type=let-the-person-in" is generic, say
> "let-the-person-in-if-they-have-a-session", then it would seem to me,
to
> make more sense for that check to be done implicitly as part of the
> match.
>
> Otherwise you could clutter your sitemap with
> <map:act type=let-the-person-in> in almost every pipeline.
Michael,
Have you considered using just one pipeline? Or two (and no more than
two)?
> This is not a good thing, especially if you have lots of complex
pipelines.
Here I fail to see how this is much simpler than using action. Why not
just:
...
<map:act type="let-person-in-if-they-have-session">
> <map:match pattern="URI1*">
> ...
> </map:match>
>
> <map:match pattern="URI2*">
> ...
> </map:match>
>
> ...
</map:act>
Vadim
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [PROPOSAL] Ref: Bug 7713 - Optional Implicit precondtion checking in matchers
Posted by Michael Melhem <mi...@fztig938.bank.dresdner.net>.
On Wed, Apr 03, 2002 at 01:03:22PM +0100, Stuart Roebuck wrote:
>
> On Wednesday, April 3, 2002, at 12:00 PM, Michael Melhem wrote:
>
> >Hi everyone,
> >
> >I trust you all had a good easter break :-)
> >
> >This is a propasal for the introduction of implicit precondition
> >checking
> >in matchers. Please refer to Bug 7713 for more information!!
> >You can find the patch for this proposal as a part of Bug 7713.
> >
> >Here I outline some of the reasoning for this proposal...
> >
> >While writing a large c2 based application we have come to the
> >conclusion that matchers with built-in *implicit* checks would be
> >desirable.
> >
> >For Example, instead of using a "valid session checker action"
> >in *every* single pipeline in the sitemap to secure against clients
> >who do not have sessions, we simply configure a matcher with a
> >"session-exists precondition". That way, we simplify sitemap pipelines,
> >which we find are already too large and complex.
> >
> >There are several advantages with implicit matcher checking including,
> >simplified sitemaps, scalablity, easier development with developers
> >not having to remember to always include certian actions, hiding of
> >unnecessary and repetitive information, etc
> >
> >Of course precondition matchers are not useful in every situation,
> >but are of best advantage when ones finds themselves using the
> >same general actions in a lot of the sitemap pipelines.
> >
> >Any comments?
>
> From your description it sounds like existing facility for embedding
> match statements might do the trick:
>
> <map:match pattern="*">
> <map:act type="let-the-person-in">
>
> <map:match pattern="match1">
> ...
> </map:match>
>
> <map:match pattern="match2">
> ...
> </map:match>
>
> ...
> </map:act>
> </map:match>
>
> Stuart.
Hi stuart,
Thanks for your input.
Yes, you are correct, one could *explicitly* use actions and
embedded matchers to do the same thing.
However when the "map:act type=let-the-person-in" is generic, say
"let-the-person-in-if-they-have-a-session", then it would seem to me, to
make more sense for that check to be done implicitly as part of the
match.
Otherwise you could clutter your sitemap with
<map:act type=let-the-person-in> in almost every pipeline.
This is not a good thing, especially if you have lots of complex pipelines.
Example:-
<map:matcher name="wildcardURI"
logger="sitemap.matcher.wildcardURI"
src="org.apache.cocoon.matching.WildcardURIMatcher" >
<conditional>path.to.let-person-in-if-they-have-session</conditional>
</map:matcher>
........................
<map:match pattern="URI1*">
no need for genric action check here
...
</map:match>
<map:match pattern="URI2*">
no need for genric action check here
...
</map:match>
...
>
>
> Public Key - 1024D/88DD65AF 2001-11-23 Stuart Roebuck (Adolos)
> Key fingerprint = 89D9 E405 F8B1 9B22 0FA2 F2C1 9E57 5AB1 88DD 65AF
> -------------------------------------------------------------------------
> Stuart Roebuck, BSc, MBA Tel.: 0131 228 4853 / Fax.: 0870 054 8322
> Managing Director
> ADOLOS <http://www.adolos.com/>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>
Regards,
Michael Melhem
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [PROPOSAL] Ref: Bug 7713 - Optional Implicit precondtion checking in matchers
Posted by Stuart Roebuck <st...@adolos.co.uk>.
On Wednesday, April 3, 2002, at 12:00 PM, Michael Melhem wrote:
> Hi everyone,
>
> I trust you all had a good easter break :-)
>
> This is a propasal for the introduction of implicit precondition
> checking
> in matchers. Please refer to Bug 7713 for more information!!
> You can find the patch for this proposal as a part of Bug 7713.
>
> Here I outline some of the reasoning for this proposal...
>
> While writing a large c2 based application we have come to the
> conclusion that matchers with built-in *implicit* checks would be
> desirable.
>
> For Example, instead of using a "valid session checker action"
> in *every* single pipeline in the sitemap to secure against clients
> who do not have sessions, we simply configure a matcher with a
> "session-exists precondition". That way, we simplify sitemap pipelines,
> which we find are already too large and complex.
>
> There are several advantages with implicit matcher checking including,
> simplified sitemaps, scalablity, easier development with developers
> not having to remember to always include certian actions, hiding of
> unnecessary and repetitive information, etc
>
> Of course precondition matchers are not useful in every situation,
> but are of best advantage when ones finds themselves using the
> same general actions in a lot of the sitemap pipelines.
>
> Any comments?
From your description it sounds like existing facility for embedding
match statements might do the trick:
<map:match pattern="*">
<map:act type="let-the-person-in">
<map:match pattern="match1">
...
</map:match>
<map:match pattern="match2">
...
</map:match>
...
</map:act>
</map:match>
Stuart.
Public Key - 1024D/88DD65AF 2001-11-23 Stuart Roebuck (Adolos)
Key fingerprint = 89D9 E405 F8B1 9B22 0FA2 F2C1 9E57 5AB1 88DD 65AF
-------------------------------------------------------------------------
Stuart Roebuck, BSc, MBA Tel.: 0131 228 4853 / Fax.: 0870 054 8322
Managing Director
ADOLOS <http://www.adolos.com/>
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org