Team,

There are two possible API changes I am wondering if
we should make.  I'm thinking about longer-term market
share of our 1.0 product, even if things get rocky for
us for a few months.  Simon's changes are making the
HEAD code in FOP close to being useful, and so we may
have a narrowing window of opportunity in getting the
right API for us for 1.0.

Two ideas, I'm not 100% sure on either but they seem
to me to be potentially good for us:

1.)  Drop the apps.Driver class and incorporate its
remaining code into apps.Fop.

Reason:  "Fop" appears to be a better self-documenting
class name within user's embedded code.  It's also a
neat name for a product.  User's code would move from
looking like this:

// Construct driver
Driver driver = new Driver();
           
// Setup Renderer
driver.setRenderer(Driver.RENDER_PDF);
....
Result res = new SAXResult(driver.
getContentHandler());


To this:

// Construct FOP instance
Fop fop = new Fop();
            
// Setup Renderer
fop.setRenderer(Fop.RENDER_PDF);
....
Result res = new SAXResult(fop. getContentHandler());

Does the lower look better--over the long term, will
it make FOP more well known, more used?  

Note:  Backward compatibility headaches will be there
but perhaps less of an issue, due to the changed
logger (i.e., user code may have to change anyway). 
And we have some precedence: the Struts team, in the
1.1 release, did not make it backwards compatible with
1.0.2, and appears none the worse with its user base
because of it.  And by having a much more solid API in
1.1 (compared to trying to juggle two APIs), is
probably grabbed many more new users as well.

Also, in the year I've been on FOP, the Driver class
has fallen from about 780 to 400 lines of code, so it
wouldn't be that overwhelming to the apps.Fop class.


2.)  Shall we roll the dice?  I wonder if we should go
 100% JAXP for 1.0, i.e. coding just like this [1] for
SAXSources and [2] for DOMSources, and removing the
older methods from Driver where one would be using
XSLTInputHandler.  We're currently that way with [2]
(As of yesterday ;), the question is should we go that
way with [1] now?

[1]
http://cvs.apache.org/viewcvs.cgi/xml-fop/examples/embedding/java/embedding/ExampleXML2PDF.java?rev=HEAD

[2]
http://cvs.apache.org/viewcvs.cgi/xml-fop/examples/embedding/java/embedding/ExampleDOM2PDF.java?rev=HEAD

By keeping everyone coding the same way this will keep
our user lists very clear, streamlined and useful for
everyone.  It is very good for our user base to be on
JAXP--good for them, for FOP, and the Java community. 
Also, Driver can be very nicely simplified were some
of these render() functions removed in favor of
getContentHandler().

FYI, for about 18 months now Jeremias' examples on the
embedding page have been JAXP-only, and we removed
just about every reference on the embed page to
XSLTInputHandler about a year ago.  (Note: I'm not
recommending the removal of XSLTInputHandler, it is
still very much in use in our code, and does a good
job.  Just recommending the removal of functions from
Driver that would cause one to want to use it
externally.)

Sorry for the long post.

Thoughts?

Thanks,
Glen

Reply via email to