forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Turner <je...@apache.org>
Subject Re: cvs commit: xml-forrest/src/resources/conf aggregate.xmap dtd.xmap faq.xmap forrest.xmap issues.xmap linkmap.xmap menu.xmap profiler.xmap raw.xmap resources.xmap revisions.xmap sitemap.xmap status.xmap
Date Thu, 07 Aug 2003 09:59:23 GMT
On Thu, Aug 07, 2003 at 11:17:34AM +0200, Juan Jose Pablos wrote:
> Jeff,
> 
> Why do we have this?:
> 
> 
>     <map:transformers default="xslt"/>
>     <map:readers default="resource"/>
>     <map:matchers default="wildcard"/>
>     <map:selectors default="browser"/>
>   </map:components>
> 
>   <map:resources>
>   </map:resources>
> 
> They do nothing.

They act as documentation, and make the subsitemap's interface with the
owner sitemap explicit.  It's like declaring your dependencies; always a
good thing.  Also, when next someone wants to add a transformer, they can
immediately see where to add the component definition, and don't risk
incorrectly redefining the default.

> I thought that we where going to move all the map:components to the 
> submaps, to ensure that there is not references. Why they still some on 
> sitemap?

Because you are right that duplication is not a good thing.  This is a
tradeoff.  Some components ('xml', 'xslt', 'html' etc) are used
everywhere, and their definition is typically very stable.  If a
component is a) used in multiple places, b) has a stable component
definition, then it should go in sitemap.xmap.


> I got the feeling that we are in square one.

Square one was a good square ;P

> When you have this on a submap:
> 
> <map:generate type="file" src="...."/>  It will get the definition from 
> sitemap, so you have a reference.
> 
> To avoid this you need to define all the coomponents on the submap, I 
> attached a patch on status so you can see what It the result.

There are two extremes:

1. Subsitemaps redeclare their components:

  Advantage    : makes them very independent and reusable
  Disadvantage : *lots* of duplicate definitions

2. sitemap.xmap declares all components:

  Advantage    : 100% reuse, only need modify a component in one place
  Disadvantage : makes it impossible to override sitemap.xmap

'Square one' is the compromise between these extremes.  We put common,
stable component definitions in sitemap.xmap, and put all others closest
to where they are used, in the subsitemaps.


--Jeff


> 
> Cheers,
> Cheche
> 


Mime
View raw message