cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephan Michels <step...@apache.org>
Subject RE: Defining Source Interfaces
Date Thu, 09 Jan 2003 10:14:47 GMT


On Thu, 9 Jan 2003, Carsten Ziegeler wrote:

>
> Stephan Michels wrote:
> > Carsten Ziegeler wrote:
> > >
> > > 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.
> >
> > agreed.
> >
> > > 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)
> >
> > I thought these operations are a kind of writing operations.
> >
> > > 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.
> >
> > I like code sippets ;-)
>
> sippets? :) (ok, just kidding)

okay okay 'snippet' ;-)

> >
> > class MySource implements MoveableSource
> > {
> >  void copy(Source source)
> >  {
> >    // impementation depending copy
> >  }
> > }
> >
> > class SourceCopyUtil<whatever>
> > {
> >  void copy(Source from, Source to)
> >  {
> >    If ((from instanceof MoveableSource) &&
> >        (from.getClass().equals(to.getClass()))
> >     // impementation depending copy
> >     ((MoveableSource)from).copy(to);
> >    else
> >     IS/OS copy
> >  }
> > }
> >
> > Something like that?
> >
> Exactly.
>
> Would you suggest to have two interfaces, one for copying
> and one for moving?

No, I think if we have a source, which we can copy, we
will always have a source, which we can also move.

So can we use org/apache/cocoon/components/source/SourceUtil
for the external copy? I think so.

> Or is it ok, to implement a move as a copy/delete?

Not really.

Stephan Michels.


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


Mime
View raw message