> * A way to specify the output format and output target

Yep.  This is really at the heart of what a 'Serializer' interface should
be.  How separate is this from the factory methods?  setOutputStream might
be a specific case.

> * A way to serialize a DOM tree

This doesn't need to be, and shouldn't be, IMHO, part of the Serializer
interface.  If I want to create a DocumentHandler that serializes, and
implements setOutputStream, why should I also have to implement serializer
methods that take a DOM node, when there are plenty of other classes that
walk the DOM and produce SAX events?

> * A way to retuirn a DocumentHandler that can be fed to an event source

This is really a factory method.

> It could be implemented any other way, and other serializers do not need
> to extend BaseSerializer. They only need to implement the Serializer
> interface.

Exactly.  My point is that something like setOutputStream does not need to
be in an interface that derives from DocumentHandler.

-scott





Reply via email to