[jdom-interest] Thread safe question: OK for simultaneous read-only access?

rpcee rpcee at operamail.com
Mon Oct 29 05:57:12 PST 2001

I'm writing something that generates interfaces for the public methods in jdom 
classes, a default implementation (which implements the i/f and extends the 
corresponding JDOM class), and optionally a SAXBuilder subclass to build using 
the default implementations.

The problem is you get quite a large interface where many of the 
implementations will be the same (helper methods eg getChildText) so I wonder 
whether the i/f should contain only core methods and use helpers to do non 
core things. This would mean I only have a subset of the documented API 
available (but all of the functionality).
The application code will also contain more casting, eg:
   IElement parent = (IElement) e.getParent();
Might it be easier to cheat and just make a customised org.jdom.Element which 
implements IElement? This way I could use the org.jdom.output.* stuff too.

The reason I'm doing this is to use the JDOM API on things that aren't 
subclasses of JDOM classes.

Thanks, rich.

>===== Original Message From "Attila Szegedi" <szegedia at freemail.hu> =====
>I don't know if anyone works on such thing, but one thing that comes to mind 
is that this kind of "wrappers" could be implemented very elegantly if JDOM 
were designed in terms of interfaces + default implementation.

More information about the jdom-interest mailing list