cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler" <cziege...@s-und-n.de>
Subject RE: Source / SourceFactory best practice ?
Date Fri, 26 Apr 2002 14:50:15 GMT

TREGAN Fabien wrote:
> 
> Depending on the samples, there are to different way of resolving 
> the source
> URL :
> 
> 1- The Factory send the whole location to the Source's constructor, wich
> deal with it
> 2- The Factory parse the location, and call the constructor with typed
> parameters (or trhows MalformerURLException)
> 
> Is there one of this you considere as preferable ?
> 
It depends. For most cases I personally prefer 1) where the factory is 
only a real factory for creating components and therefore passes everything
on to the Source object.

Solution 2) can be/is used where it is possible to reuse concrete Source
implementations. This means for example two different factories use the
same Source implementations and therefore create the necessary parameters
and pass them on.

HTH
Carsten

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message