Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] ClassLoader issues

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
  • To: Laurent Bihanic <laurent.bihanic AT atosorigin.com>, XOM-interest <XOM-interest AT lists.ibiblio.org>
  • Subject: [XOM-interest] ClassLoader issues
  • Date: Thu, 19 Sep 2002 10:12:04 -0400

At 10:33 AM +0200 9/19/02, Laurent Bihanic wrote:


- ClassLoader issues: Type-safe enumerations, such as Attribute.Type, do not fit well with class loaders, even when implementing equals() (see http://www.javaworld.com/javatips/jw-javatip122_p.html).


This is an issue. I'm not sure what to do about it. Last night I reread the Bloch section on type-safe enums and he does not address this point at all. Certainly class loaders can be a problem in servlet containers, IDEs, and more. I've encountered this personally.

Here's one possibility: I add an equals() method to the Atrribute.Type class that can be used if client code is likely to be in a multi-loader environment. That would make the implementation more complex. I don't want to go to a straight int enum because type-safety is important to me. Thoughts?
--

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo AT metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
| XML in a Nutshell, 2nd Edition (O'Reilly, 2002) |
| http://www.cafeconleche.org/books/xian2/ |
| http://www.amazon.com/exec/obidos/ISBN%3D0596002920/cafeaulaitA/ |
+----------------------------------+---------------------------------+
| Read Cafe au Lait for Java News: http://www.cafeaulait.org/ |
| Read Cafe con Leche for XML News: http://www.cafeconleche.org/ |
+----------------------------------+---------------------------------+




Archive powered by MHonArc 2.6.24.

Top of Page