Carsten Ziegeler wrote:
Sylvain Wallez wrote:
Oh, believe me - a lot of projects and companies are using it! I getCarsten Ziegeler wrote:I guess you're joking, but is this good or bad ? Who else beside Cocoon is using the source package in Excalibur ?I think it's time to define the WriteableSource etc. interfaces for the excalibur source package and move them out of Cocoon. What do you think about this? This would move the responsibility to excalibur :)
several support questions for that package every month from various
places.
So, to be true: no, it's not a joke.
Ok. Then that's good.
Because a Collection is a concrete object (it holds the children) whereas an Iterator is just a moving cursor that can be used only once on that Collection.Yes, that is true. But always doing an instanceof is not the best adviceWell, look in the 2.1 scratchpad where there's a lot of yummy stuff : TraversableSource, VersionableSource, LockableSource, etc.I added before christmas the possibility to retrieve children of a source to the Source interface in excalibur and started with the ModifiableSource interface (= WriteableSource). What else do we need? I think we have a buch of extensions to the Source interface.
While working on sources recently (the CVSSource I'm about to publish), I found the current definition of TraversableSource not intuitive, and modified it so it's more like to java.io.File :
public interface TraversableSource extends Source {
/** Is the source a directory or a collection ? */
public boolean isSourceCollection() throws ProcessingException, IOException;
/** Returns the collection of child sources. */
public Collection getChildren() throws ProcessingException, IOException;
/** Returns the local name of this source */
public String getName() throws ProcessingException, IOException;
/** Return the parent source. Returns null if the source hasn't a parent. */
public Source getParentSource() throws ProcessingException, IOException;
}
Stephan, others, what about these changes ?
Carsten, I also some remarks/questions about your changes in Excalibur :
- should parent/child traversal be defined on Source. IMO, a Source should be kept very simple and basic as not all sources are traversable,
for doing OOP. So, I thought of adding the most common methods to the base
interface and only use extending interfaces if required.
- why does getChildrenLocation return an Iterator (and not a Collection) of URIs (and Sources) ?Hmm, why not Iterator? Why is Collection better?
Sylvain
--
Sylvain Wallez Anyware Technologies
http://www.apache.org/~sylvain http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]