cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Giacomo Pati <pati_giac...@yahoo.com>
Subject Re: [C2] Sitemap revised again
Date Fri, 30 Jun 2000 06:32:06 GMT

--- Stefano Mazzocchi <stefano@apache.org> wrote:
> the matcher interface is similar to the Chooser one but different
> 
>  public interface Matcher implements Component {
>    public Map match(String pattern, ...);
>  }

I'm stumbled over the fact that this Interface didn't show if the matcher was indeed successfully
matching a given pattern when the pattern does not contain any wildcards:

<map:match type="uri-wildcard-matcher" pattern="/my/fancy/page">
  ...
</map:match>

A solution can be that we can dictate that the returned Map must have a specific entry like
matched=Boolean to make the SitemapProcessor aware of a match. I personaly think this is somehow
weak and doesn't force the matcher to do so. Maybe extending the Interface would be a better
solution:

 public interface Matcher implements Component {
   public Map match(String pattern, Boolean matched, ...);
 }

or exchange Map and boolean to 

 public interface Matcher implements Component {
   public boolean match(HashMap map, String pattern, ...);
 }

where the SitemapProcessor supplies the Map and we have the Matcher to supports a specific
Map
like the HashMap supposed above. This design support the possibility to put unused Maps into
a
pool for later use to eliminate some GC and instantiation overhead in favor to the matcher.clean()
method.

What is your oppinion to this?

Giacomo

=====
--
PWR GmbH, Organisation & Entwicklung      Tel:   +41 (0)1 856 2202
Giacomo Pati, CTO/CEO                     Fax:   +41 (0)1 856 2201
Hintereichenstrasse 7                     Mailto:Giacomo.Pati@pwr.ch
CH-8166 Niederweningen                    Web:   http://www.pwr.ch

__________________________________________________
Do You Yahoo!?
Get Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/

Mime
View raw message