cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Dumon <br...@outerthought.org>
Subject RE: [proposal] some changes toSourceResolver.resolve(baseURI,location, params)
Date Mon, 26 May 2003 12:39:58 GMT
On Mon, 2003-05-26 at 14:08, Carsten Ziegeler wrote:
> Bruno Dumon wrote:
> > >  - so if this can still be kept compatible
> > > perhaps by using a "new ExtendedSourceFactory" interface it
> > > would be great.
> > > 
> > > What do you think?
> > > 
> > 
> > Another idea just entered my mind (via marc): what about adding an extra
> > set of components to handle relative-to-absolute uri conversion, in
> > parallel with the source resolver factories.
> > 
> > For each scheme, it is then possible to define the relative uri
> > resolving strategy to use.
> > 
> > <uri-absolutizers>
> >   <component-instance class="...DefaultAbsolutizer" name="*"/>
> >   <component-instance class="...NoAuthorityAbsolutizer" name="cocoon"/>
> >   <component-instance class="...NoAuthorityAbsolutizer" name="context"/>
> >   <component-instance class="...NotSupportedAbsolutizer" name="mailto"/>
> > </uri-absolutizers>
> > 
> > This would also solve the backwards-incompatibility problem, and
> > generally seems like a nicer solution to me.
> > 
> Hmm, this seems a little bit like overcomponentization to me.

Yeah, you are right. Having second thoughts on this too.

>  It is a 
> compatible way, yes, but configuring this is more difficult I think
> and if I add a new protocol I have also to add an uri-absolutizer.
> I'm just wondering, how many methods there are for uri-absolutizing?

Normally only one, with the extra possibility of not supporting
uri-absolutizing, and the special cocoon/context cases.

Ok, back to the new-interface approach: rather than using an
ExtendedSourceFactory interface, how about letting the SourceFactory
optionally implement an additional interface, URIAbsolutizer. If
present, that interface will be asked to perform the uri-absolutizing
process, otherwise the default method will be used.

The interface would thus look like:

public interface URIAbsolutizer {
  public String absolutize(String baseURI, String location);
}

The difference with ExtendedSourceFactory is that this one will only be
implemented in case the absolutize-strategy differs from the default
behaviour, while ExtendedSourceFactory more sounds like a successor to
the current SourceFactory.

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


Mime
View raw message