You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Glen Mazza <gm...@apache.org> on 2005/05/17 00:14:52 UTC

Layout simplifications

Team,

Currently the LM classes that use the Knuth breaking strategy employ the 
breaking via a nested (inner) class -- 
PageSequenceLayoutManager.PageBreaker, for example.  This is causing 
some duplication in methods (getNextKnuthElements(), for example) and 
variables in each of the Breaker classes.  Also, AbstractBreaker has to 
duplicate methods already available in AbstractLayoutManager because it 
does not extend it.

What I would like to do is the following (step-by-step, not proceeding 
until each stage works):

1.)   Have AbstractBreaker extend AbstractLayoutManager (ALM).

2.)   Remove the PageBreaker inner class from PSLM, and have PSLM 
directly extend AbstractBreaker.  Refactor and remove any duplicate 
methods and variables.

3.)   Rename AbstractBreaker to AbstractBreakingLayoutManager (or similar).

4.)   One by one, remove the nested inner classes from those other 
breaking LM classes:  removing any duplicate methods or functionality 
already available in the base class, and having those classes extend 
ABLM instead of ALM.  (Only those LM classes which do breaking will 
extend ABLM--the rest will continue with ALM.)

5.)  Refactor/simplify AbstractBreakingLayoutManager, taking advantage 
of methods already available in AbstractLayoutManager.  
Refactor/simplify the ABLM-extended classes, again resulting from 
insights during this process.

6.)  (possibly) Create a BreakingLayoutManager interface (extending 
LayoutManager interface?), just to keep note of the delta between ABLM 
and ALM.

I think if we do this, it will allow for more simplifications and 
insights into the layout coding, and make it easier to understand.  I 
don't think we can afford the duplication as-is--my experience so far 
with FOP is that simplifying engenders more simplifications, while lard 
ends up begetting more lard.

Thoughts/comments?

Thanks,
Glen