Return-Path: Delivered-To: apmail-xml-cocoon-dev-archive@xml.apache.org Received: (qmail 80579 invoked by uid 500); 9 Jan 2003 08:35:42 -0000 Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-dev@xml.apache.org Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 80541 invoked from network); 9 Jan 2003 08:35:42 -0000 From: "Carsten Ziegeler" To: Subject: RE: Defining Source Interfaces Date: Thu, 9 Jan 2003 09:30:53 +0100 Message-ID: MIME-Version: 1.0 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Importance: Normal X-MIMETrack: Itemize by SMTP Server on PBSN1/Systeme und Netzwerke(Release 5.0.8 |June 18, 2001) at 09.01.2003 09:35:52, Serialize by Router on PBSN1/Systeme und Netzwerke(Release 5.0.8 |June 18, 2001) at 09.01.2003 09:35:53, Serialize complete at 09.01.2003 09:35:53 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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) > > class MySource implements MoveableSource > { > void copy(Source source) > { > // impementation depending copy > } > } > > class SourceCopyUtil > { > 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? Or is it ok, to implement a move as a copy/delete? Carsten --------------------------------------------------------------------- To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org For additional commands, email: cocoon-dev-help@xml.apache.org