forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Turner <je...@apache.org>
Subject Where to put components (Re: cvs commit: ...)
Date Thu, 07 Aug 2003 11:46:04 GMT
On Thu, Aug 07, 2003 at 12:47:24PM +0200, Juan Jose Pablos wrote:
> jeff,
> 
> >>
> >>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.
> 
> IMO it is confused, for status there is not map:readers map:selectors or 
> map:resources but you have those entries there.

status.xmap does not use any readers, selectors or resources, so why
should it declare a dependency on any, or define any?

status.xmap does use generators, transformers and serializers, so there
should probably be 

<map:components>
  <map:generators default="file"/>
  <map:transformers default="xslt"/>
  <map:serializer type="html"/>
<//map:components>


> > 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.
> >
> 
> But if they want to define the same one, they will try to duplicate as 
> it happens (this was how started)

I'm not following.  If I see

  <map:transformers default="xslt"/>

I know that this subsitemap expects 'xslt' to be defined for it.  Why
would I redefine it?  If I wanted to, what's wrong with that?

> >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.
> >
> ok,
> so why forrest.xmap and raw.xmap still defining html generators, can see 
> my point about getting things tidier?

Yes, there is room for improvement.  Since only raw.xmap uses the HTML
generator, it should probably only be defined there.

> when a component definition is move it to sitemap.xmap then users that
> overwrite sitemap will get its site broken, because of that I thought
> that if you put it on sitemap in the first place less you play safe.

Yes I see that.  For example, if we defined the HTML generator only in
raw.xmap, and then later moved it to sitemap.xmap, we'd break things.
However, we could always leave a duplicate definition in raw.xmap.  The
other way round (moving from sitemap.xmap to a subsitemap) always breaks
things.  It is still better to start with a limited scope, and then
expand it if necessary.


--Jeff


> Cheers,
> cheche
> 
> 
> 

Mime
View raw message