commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 17036] - PropertyUtils doesn't recognise "normal" properties on a DynaBean decendent object.
Date Wed, 26 Mar 2003 18:24:03 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17036>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17036

PropertyUtils doesn't recognise "normal" properties on a DynaBean decendent object.

rdonkin@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |WONTFIX



------- Additional Comments From rdonkin@apache.org  2003-03-26 18:24 -------
the consensus is that the current behaviour is correct. if you want to call the
real property on a DynaBean, the right way to do this is to add them explicitly.

On Tuesday, March 25, 2003, at 11:56 PM, Craig R. McClanahan wrote:

>On Tue, 25 Mar 2003, robert burrell donkin wrote:
>
>Date: Tue, 25 Mar 2003 23:12:56 +0000
>From: robert burrell donkin <robertburrelldonkin@blueyonder.co.uk>
>Reply-To: Jakarta Commons Developers List <commons-dev@jakarta.apache.org>
>To: Jakarta Commons Developers List <commons-dev@jakarta.apache.org>
>Subject: [beanutils] bug#17036 PropertyUtils doesn't recognise "normal"
>    properties on a DynaBean
>
>PropertyUtils doesn't recognise "normal" properties on a DynaBean (see
>http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17036).
>
>can anyone think of any good reasons why i shouldn't change beanutils so
>that normal properties are available if none of the dynabean properties
>match?
>

Personally, I think that doing this would be *really* confusing.  Just for
one example, consider how one determines the names of all the properties
supported by a DynaBean instance:

  DynaProperty properties[] = dynaBean.getDynaClass().getDynaProperties();

In today's implementation, the set of properties you get back represents
100% of the set of things that can be manipulated via get() and set()
calls -- and you will get IAE if you try them with any other name.  If you
make the proposed change, that's no longer the case -- but it is hard to
argue that we should synthesize DynaProperty instances for the "real" bean
properties as well, because they are *not* dynamic properties.

A second confusion relates to whether or not sets through the standard
bean setter can be read by the dynamic getter, and vice versa:

  dynaBean.set("foo", "bar");
  dynaBean.setFoo("baz");
  String whatDoYouGet = (String) dynaBean.get("foo");
  // What do you get?

Logically, you would want to require that this return "baz" -- but that
means we would break every existing DynaBean implementation class that
already exists.  If you don't require this, then it's going to lead to all
sorts of bugs when users assume that it works that way.

I don't like it.  If you want to manipulate the standard JavaBeans
properties of a DynaBean implementation, you should just call them
directly :-)  or else use reflection yourself.

Craig

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message