On 05.03.2006 21:55:44 Simon Pepping wrote: > On Thu, Feb 23, 2006 at 10:03:29PM +0100, Simon Pepping wrote: > > On Wed, Feb 22, 2006 at 10:22:39PM +0100, Jeremias Maerki wrote: > > > > > > On 22.02.2006 21:55:36 Simon Pepping wrote: > > > > Would it not be nicer to have a constructor that takes the output > > > > stream as an argument? > > > > > > If this is preferred, no objections. However, not all output formats take > > > an OutputStream which means an increase of factory methods. > > > > For those formats that do require an OutputStream the created object > > is inconsistent, and one is only notified at runtime. The presence of > > another factory method at least suggests that it under some > > circumstances it may be necessary to create the object with an > > OutputStream. > > Added the methods. As you see from my example, I prefer early testing > of the consistency of the Fop object.
OK. However, I don't like your catching the IllegalStateException in the example code. An IllegalStateException is a descendant of RuntimeException and normally indicates a programmer error. It's not something that is usually caught. The example code should be instructive to the normal Java developer and should not distract with that try/catch around the getDefaultHandler() method IMO. Jeremias Maerki