You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Eric <ej...@ir.iit.edu> on 2000/11/19 21:12:13 UTC

difference between PropertyUtils and BeanUtils

Could someone explain what the distinction between PropertyUtils and
BeanUtils is?  Why do some methods use PropertyUtils.getProperty and
others use BeanUtils.getPropertyValue?  What's with the repeated code?
Isn't PropertyUtils generally better at dealing with properties since
it includes support for nested and indexed property names?

eric.

-- 
 _____  _ 
| ____|(_)     http://www.iit.edu/~jenseri
|  _|  | |     Page me via ICQ at
| |___ | |     http://wwp.mirabilis.com/19022931
|______/ |     or by mailing 19022931@pager.mirabilis.com
     |__/

Re: difference between PropertyUtils and BeanUtils

Posted by Eric <ej...@ir.iit.edu>.
and BeanUtils.populate doesn't support indexed or nested
properties...can I count on support for these in struts 1.0?  i would
hate to have to distribute my modified struts libraries with my web
apps.  will PropertyUtils do type conversions eventually?

thanx,
eric.

On Sun, Nov 19, 2000 at 04:59:53PM -0800, Craig R. McClanahan wrote:
> Eric wrote:
> 
> > Could someone explain what the distinction between PropertyUtils and
> > BeanUtils is?  Why do some methods use PropertyUtils.getProperty and
> > others use BeanUtils.getPropertyValue?  What's with the repeated code?
> > Isn't PropertyUtils generally better at dealing with properties since
> > it includes support for nested and indexed property names?
> >
> 
> Fundamentally, the difference is that BeanUtils.populate does conversions from
> Strings to the appropriate data type of the property being set, while the
> PropertyUtils methods assume that you have performed any necessary conversions.
> 
> The other reality is that BeanUtils came first, and it has not yet been
> completely converted to use PropertyUtils where appropriate.
> 
> >
> > eric.
> >
> 
> Craig McClanahan
> 
> 

-- 
 _____  _ 
| ____|(_)     http://www.iit.edu/~jenseri
|  _|  | |     Page me via ICQ at
| |___ | |     http://wwp.mirabilis.com/19022931
|______/ |     or by mailing 19022931@pager.mirabilis.com
     |__/

Re: difference between PropertyUtils and BeanUtils

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Eric wrote:

> Could someone explain what the distinction between PropertyUtils and
> BeanUtils is?  Why do some methods use PropertyUtils.getProperty and
> others use BeanUtils.getPropertyValue?  What's with the repeated code?
> Isn't PropertyUtils generally better at dealing with properties since
> it includes support for nested and indexed property names?
>

Fundamentally, the difference is that BeanUtils.populate does conversions from
Strings to the appropriate data type of the property being set, while the
PropertyUtils methods assume that you have performed any necessary conversions.

The other reality is that BeanUtils came first, and it has not yet been
completely converted to use PropertyUtils where appropriate.

>
> eric.
>

Craig McClanahan



Re: difference between PropertyUtils and BeanUtils

Posted by Eric <ej...@ir.iit.edu>.
Ah wait, BeanUtils.getPropertyValue actually calls
PropertyUtils.getProperty...I guess that was a bad example...there are
still pieces of code that don't use PropertyUtils though, like
BeanUtils.populate...why is this?

eric.

On Sun, Nov 19, 2000 at 02:12:13PM -0600, Eric wrote:
> Could someone explain what the distinction between PropertyUtils and
> BeanUtils is?  Why do some methods use PropertyUtils.getProperty and
> others use BeanUtils.getPropertyValue?  What's with the repeated code?
> Isn't PropertyUtils generally better at dealing with properties since
> it includes support for nested and indexed property names?
> 
> eric.
> 
> -- 
>  _____  _ 
> | ____|(_)     http://www.iit.edu/~jenseri
> |  _|  | |     Page me via ICQ at
> | |___ | |     http://wwp.mirabilis.com/19022931
> |______/ |     or by mailing 19022931@pager.mirabilis.com
>      |__/

-- 
 _____  _ 
| ____|(_)     http://www.iit.edu/~jenseri
|  _|  | |     Page me via ICQ at
| |___ | |     http://wwp.mirabilis.com/19022931
|______/ |     or by mailing 19022931@pager.mirabilis.com
     |__/