On Tuesday 26 March 2002 22:11 pm, Erik Hatcher wrote: > I think you can > get PatternSet to do what you want, you just have to do it a different way > - only call one of the methods and you get the 'set' functionality you want > (again, encapsulate, don't extend in this case).
i can refactor my class all day long, but in no case can i use the same PatternSet or FileSet twice (for two different, but mostly similar tasks, in which most properties are left the same on each run). This cannot be done using those classes unless they provide, for example, a resetter method or a way to get a handle directly on their data members (which i generally don't condone, but it has it's place). > If we're talking > subclassing actual Ant tasks - my vote is to refactor the functionality out > into standalone code that can be reused by the task. In this case it would Still mean adding functionality to PatternSet and FileSet to allow them to be reset. (PatternSet delegates to FileSet, but PatternSet would need to provide the setter to pass the call on to it's internal FileSet object.) > Wrong, it would work - PatternSet can 'set' patterns - and yes it appends, > but only set once and you've got your 'set' capability! See? The function is rather misnamed, though, for it's functionality, you must admit. (Though i understand that it must be called this, for reflection.) In *any* case, the API docs are now patched, so nobody will fall into this set/append trap again ;). > Jar, however, is not, at least not to the extent of adding > features like you are doing. Jar extends Zip, which was probably also not designed to be extended - the only thing they share, AFAIK, is the actual compression format, and that could have been delegated into a ZipFile object (and would have been, i suspect, if you had designed it). ----- stephan Generic Unix Computer Guy [EMAIL PROTECTED] - http://www.einsurance.de Office: +49 (89) �552 92 862 Handy: �+49 (179) 211 97 67 "...control is a degree of inhibition, and a system which is perfectly inhibited is completely frozen." -- Alan W. Watts -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
