[jdom-interest] Why not interfaces?

Jason Hunter jhunter at collab.net
Fri Sep 8 11:39:57 PDT 2000

>   Parsing large, complex XML documents.
> JDOM fails the same was DOM does: Before a document can be used, it
> must be completely parsed. If you don't have enough memory, to bad. If
> you're running on a small device, too bad. If you only need a few
> important pieces in the document, too bad.
> IF JDOM supported interfaces, I could implement a version of Document
> that only parsed as much of the document as was necessary to provide
> the requested data.

You can do that today.  Write a subclass of Element!  The Element
implementation and design has specifically been created to support a
deferred parse design.

> IF JDOM supported flexible factories, I could implement a light weight
> caching parser that returned my on-demand Document.

Write a DeferredBuilder that builds a document containing
DeferredElement instances.  No generic factory model needed!  People
will interact with the document using the API of the base class Element,
but it'll behave according to the DeferredElement implementation.


More information about the jdom-interest mailing list