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: Defining Source Interfaces
Date Wed, 08 Jan 2003 16:14:20 GMT
Sylvain Wallez wrote:
> >
> >The problem is, if you are using getInputStream/getOutputSteam to copy
> >a file in a slide repository, that all metadata informations get lost. On
> >the other hand, if you are using an external SourceUtil to copy a file,
> >you can't hide all implementation details.
> >
> >
>
> Ah, I got it now : if the copied/moved source is of the same type than
> the "source" source, then some optimisations are possible (like the
> above or direct filesystem copy), else we fallback to a generic
> getInputStream/getOutputStream implementation, right ?
>
> So it makes sense after all to keep them on the
> [Modifiable/Writeable/Whatever]Source
>
No, I don't think so (sorry, I have to do this :) )

Now, think if an implementation for copy(). Each Source implementation
must test if the destination is the same source implementation or not.
If not use IS/OS if yes use optimized etc.
So, if we are using these "marker" interfaces for all other parts, I
really think we should add a "MoveableSource" (substitute the name if you
like) and have an utility class check if:
a) both sources have the same implementation and
b) implement MoveableSource
If both is answered with yes, this can be used - if not the utility class
uses IS/OS copying.

It's the magic of SoC - if a source is not interested in move/copy it should
not have to care about it.

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