xml-xmlbeans-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Bau" <david....@bea.com>
Subject Re: deprecated methods
Date Tue, 13 Jan 2004 22:57:23 GMT
Hi Michael,

The reason that you can't find the debate on the lists was that the
@deprecation happened before the code was contributed to Apache!  There was
a pre-Apache debate...  I don't remember all the details, but the reasoning
went something like this.

(1) Generated XMLBeans look just like JavaBeans, by design.

(2) The various JavaBeans tools out there inspect bean-like objects by
looking at all the "getX"/"setX" methods, and showing the values.  For
example, a visual debugger might know how to display or edit a JavaBean with
nicely named getters and setters.  A JSP/struts-like binding tool might know
how to work with setX and getX.

(3) But the intValue() and set() methods don't conform to that naming
convention, and so are invisible to those kinds of tools.  The intValue is
arguably the most interesting thing inside any XmlInt (or any complex type
that might derive from XmlInt), so this is a major outage for those users.

(4) One possible name to use would be to say setValue() and getValue().  But
this has two disadvantages: (i) "value" is a common enough XML element name
that it's just begging for a conflict, where "intValue" is not. (ii) any
class that needs to implement two different getValue() methods of different
types would run into a conflict in Java (e.g., in schema, an int is also a
long, integer, and a decimal).

(5) So it was settled that getIntValue() and setIntValue() would be the
names to use.

We can certainly debate whether they should be undeprecated and changed back
(the original names from before were mine and I liked them too), but I think
the the argument for the change was strong.

David

----- Original Message ----- 
From: "Allman, Michael" <Michael.Allman@ssa.gov>
To: <xmlbeans-dev@xml.apache.org>
Sent: Tuesday, January 13, 2004 11:34 AM
Subject: [xmlbeans-dev] deprecated methods


> Can someone explain why methods such as XmlInt.intValue() and XmlInt.set()
> have been deprecated in favor of JavaBean-like getters and setters?  I
can't
> find any background on this change in the mailing list archive or CVS.
> Similar changes have been made to the XmlInteger, XmlString, XmlFloat and
> other interfaces.  I'm sure there must be some good reason I'm
overlooking.
>
> I like the way it was before.  Can we debate these changes?  Did I miss
the
> debate?
>
> Michael
>


- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


Mime
View raw message