commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton (JIRA)" <>
Subject [jira] Commented: (BEANUTILS-185) [beanutils] Try to align BeanUtils with JSTL standard tags
Date Fri, 09 Jun 2006 18:28:30 GMT
    [ ] 

Niall Pemberton commented on BEANUTILS-185:

Thanks for the patches, however I'm not that keen on implementing what you propose.

1) In regards to RowSetDynaClass and the createDynaBean() method, the contract of that method
is IMO clear since the return type is a DynaBean - if a specific implementation was required
then the return type should have been the specific  implementation (such as BasicDynaBean).
Therefore I'm against introducing your new AbstractRowSetDynaClass as IMO its unnecessary.

Looking at RowSetDynaClass I am surprised there is a createDynaBean() method at all, since
DynaClass defines a perfectly good public newInstance() method for that very purpose. IMO
we should deprecate the createDynaBean() method and switch to using newInstance() instead.

2) DirectAccessDynaBean gives me some concern since it is both a Map and a DynaBean and I'm
unsure whether this may confuse other BeanUtils functionality or cause it to act inconsistently.
Even if that didn't turn out to be a problem I'm against this "super" interface as I don't
see how this provides any advantage/benefit over an object that implements the two interfaces
separtely rather than this combined one.

An alternative thought I had to this is to provide a Map implementation to decorate DynaBeans
- that way any DynaBean could be decorated to look like a Map?

3) On the IndirectAccessDynaBean I'm afraid I don't see any benefit in JSTL terms since simply
adding a getMap() method to a DynaBean implementation will enable it to be used by JSTL. Also
perhaps it would have wider benefit if it was simply an interface with that one method (rather
than extending DynaBean) - that way any object could provide a Map representation of itself.

Another argument in favour of the Map decorator for a DynaBean is that it would make it very
easy for DynaBean implementations to implement a getMap() method. LazyDynaBean currently has
a getMap() - but it exposes the internal Map used to store properties - allowing the DynaBean
methods such as get/set to be circumvented and possible corruption of the contents (illegal
values for a property). This way the Map returned would under the covers still delegate to
the proper DynaBean methods.

> [beanutils] Try to align BeanUtils with JSTL standard tags
> ----------------------------------------------------------
>          Key: BEANUTILS-185
>          URL:
>      Project: Commons BeanUtils
>         Type: Improvement

>  Environment: Operating System: other
> Platform: Other
>     Reporter: Gabriel Belingueres
>     Priority: Minor
>  Attachments:,,,,,,,, beanutil-diff.txt
> Hi,
> I've done some modifications to the beanutils package to better support the use 
> of DynaBeans with the JSTL tags. Some of the changes are discussed in this 
> thread of the commons-user mailing list:
> I attach the diff file that comprises changes to the file 
> and build.xml file (since I added a TestCase.) Note: Please try to filter 
> carefully the diffs in the build.xml file since they include some local 
> settings I have for compilation on my machine. :-(
> Together with the diff file, I attach the new java files added to the package.
> Regards,
> Gabriel Belingueres

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message