in: coreIssues in core modules (aop, beans, core, context, expression)status: declinedA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancement
It would be wonderful if the org.springframework.beans.BeanWrapperImpl were a little less "monolithic" than it appears to be today, and had support for some pluggable PropertyAccessStrategy & PropertyMetadataAccessStrategy, à la what package org.springframework.binding in spring-rich-c (from http://www.springsource.org/spring-rcp) appears to have.
The default BeanWrapperImpl would be using an implementation of PropertyAccessStrategy doing what it does today - but one would be apply to supply it other ones, which would, for example, allow directly supporting any kind of more dynamic "Bean" implementations.
Support for DynaBean comes to mind naturally, but beyond DynaBeans as in Apache Commons BeanUtil, pluggable support for dynamic data structures such as simple Maps, Jackson JSON objects, or some XML frameworks in core Spring Beans could allow e.g. SpEL to directly access such data!
I do understand that in theory one could write one's own BeanWrapper implementation (and/or extending AbstractPropertyAccessor & PropertyEditorRegistrySupport, but as there appears to be a lot of logic in them (how to "traverse" / navigate beans, indexed & mapped access etc.) should probably stay inside BeanWrapperImpl - as long as it has some way to extend it.
2 votes, 6 watchers
The text was updated successfully, but these errors were encountered:
This is something that we may take a look at in the Spring 3.2 timeline. There are other areas where a strategy-based approach to properties could be helpful, especially with regard to other JVM languages that may have differing conventions for property method signatures.
We'd be interested to hear more about your use case. Is it actually only around DynaBeans as you mentioned above?
Note that it may be possible to achieve what you need via SpEL expressions. Would need to hear more about what you're trying to do.
At any rate, we'll leave this issue 'under consideration' for 3.2 as a place where folks can comment further, add use cases, vote, etc.
We won't be introducing a strategy quite like that anymore, since as a result of the work in #17402, we have a quite powerful AbstractNestablePropertyAccessor base class now that a custom accessor class can be derived from. BeanWrapperImpl itself is rather thin now.
in: coreIssues in core modules (aop, beans, core, context, expression)status: declinedA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancement
2 participants
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.
Michael Vorburger opened SPR-8822 and commented
It would be wonderful if the org.springframework.beans.BeanWrapperImpl were a little less "monolithic" than it appears to be today, and had support for some pluggable PropertyAccessStrategy & PropertyMetadataAccessStrategy, à la what package org.springframework.binding in spring-rich-c (from http://www.springsource.org/spring-rcp) appears to have.
The default BeanWrapperImpl would be using an implementation of PropertyAccessStrategy doing what it does today - but one would be apply to supply it other ones, which would, for example, allow directly supporting any kind of more dynamic "Bean" implementations.
Support for DynaBean comes to mind naturally, but beyond DynaBeans as in Apache Commons BeanUtil, pluggable support for dynamic data structures such as simple Maps, Jackson JSON objects, or some XML frameworks in core Spring Beans could allow e.g. SpEL to directly access such data!
I do understand that in theory one could write one's own BeanWrapper implementation (and/or extending AbstractPropertyAccessor & PropertyEditorRegistrySupport, but as there appears to be a lot of logic in them (how to "traverse" / navigate beans, indexed & mapped access etc.) should probably stay inside BeanWrapperImpl - as long as it has some way to extend it.
2 votes, 6 watchers
The text was updated successfully, but these errors were encountered: