[jdom-interest] Re: Subclassing Element vs Element Context
jozart at csi.com
Mon Nov 6 16:29:00 PST 2000
Right. I misused the term "fragile". I think any subclass carries some
extra baggage, but not all subclasses are fragile.
I think the most fragile subclass in this case is the custom SAXBuilder
required to construct the custom Element subclasses.
The most fragile things about subclassing Element itself are the aspects
dealing with serialization, equals, hashCode, and Cloneable. How
difficult these are depend on the implementation details, such as
whether the extra field is declared to be transient or not, whether
Element declares its own serialization version id, and whether (and how)
Element overrides equals, hashCode and clone.
----- Original Message -----
From: "Patrick Dowler" <Patrick.Dowler at nrc.ca>
To: "Joseph Bowbeer" <jozart at csi.com>; <jdom-interest at jdom.org>
Sent: Monday, November 06, 2000 3:31 PM
Subject: Re: [jdom-interest] Re: Subclassing Element vs Element Context
On Sat, 04 Nov 2000, Joseph Bowbeer wrote:
> Adding a userObject can accomplish a lot without forcing
> the user to subclass or to provide an external mapping.
On the other hand, subclassing for the purpose of adding a user object
and associated methods (ie. without overriding existiing behaviour) is
trivial and basically safe from delicate subclassing problems.
More information about the jdom-interest