commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton (JIRA)" <j...@apache.org>
Subject [jira] Commented: (BEANUTILS-185) [beanutils] Try to align BeanUtils with JSTL standard tags
Date Fri, 09 Jun 2006 18:28:30 GMT
    [ http://issues.apache.org/jira/browse/BEANUTILS-185?page=comments#action_12415595 ] 

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: http://issues.apache.org/jira/browse/BEANUTILS-185
>      Project: Commons BeanUtils
>         Type: Improvement

>  Environment: Operating System: other
> Platform: Other
>     Reporter: Gabriel Belingueres
>     Priority: Minor
>  Attachments: AbstractRowSetDynaClass.java, BasicDirectAccessDynaBean.java, BasicDirectAccessDynaBeanTestCase.java,
BasicIndirectAccessDynaBean.java, DirectAccessDynaBean.java, DirectRowSetDynaClass.java, IndirectAccessDynaBean.java,
IndirectRowSetDynaClass.java, 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:
> http://marc.theaimsgroup.com/?l=jakarta-commons-user&m=114669123403779&w=2
> I attach the diff file that comprises changes to the RowSetDynaClass.java 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
> gaby@ieee.org

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
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