[jdom-interest] SAXHandler's Stack to be protected ?

Alex Rosen arosen at silverstream.com
Thu Aug 23 08:27:08 PDT 2001

> Yes, that's an issue, and the principle reason I don't like making
> things protected willy-nilly.  Brett made the decision on the SAXHandler
> changes.  I'm hoping he kept the specification aspect of the change in
> mind.  :-)

If you want to make classes reasonably subclassable, then you need to make
every variable protected, and you need to chop up large methods into smaller
protected methods as much as possible, IMO. You and Brett have decided that
subclassing is the primary way to extend JDOM at least for the XML tree
objects, so that's presumably why all variables in those classes are now
protected. If SAXHandler is not supposed to be subclassed, then it's fine to
keep its variables private, but otherwise I believe that everything needs to
be protected. In other words, I think you have to choose between
subclassability and future flexibility of implementation - you can't have

Now that I think about it, I think our subclassable classes shouldn't have
any private methods either.


More information about the jdom-interest mailing list