"TargetListAggregatingBean" allows distributed collaboration to build up list-valued properties [SPR-2819] #7506
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: declined
A suggestion or change that we don't feel we should currently apply
type: enhancement
A general enhancement
Antranig Basman opened SPR-2819 and commented
Several requests are outstanding in JIRA to improve Spring support for constructing list-valued properties, but I believe there is a deeper underlying issue which can be addressed. I have written up a possible solution as "TargetListAggregatingBean"
A brief summary of the issues -
The TLAB solution allows any number of beans to express their contribution to the target list from around the context, by means of pure Spring definitions, and without exposing any additional dependencies to the recipient.
I have written up the issues and a solution on the RSF wiki on its own page:
http://www2.caret.cam.ac.uk/rsfwiki/Wiki.jsp?page=TargetListAggregatingBean
Implementation notes:
i) All licenced under a Apache 1.1-style licence, no other encumbrance
ii) implementation doesn't fundamentally have extraneous dependencies, but does currently use RSF's introspection scheme rather than javax.beans for performance reasons.
iii) Currently packaged as a standard Spring BeanPostProcessor initialised by an ApplicationListener, an implementation integrated into the Spring core could be more slick :P
Other related JIRAs:
#7488/SPR-230 - supply "adder" in addition to "setter". If adder-injection were supplied, this would ideally become TLABable.
#6382 - A TLAB-delivered list would be a very good fit for being delivered to ChainOfResponsibilityFactoryBean
#5784 - TLAB is in fact a more general implementation of "depends-on-after-created" (DOAC). The rationale for DOAC however would be unclear and most probably would reflect a poor design, unless the identified dependents were somehow delivered to the target. TLAB actually solves the underlying problem that DOAC is aimed at while insisting that the arrow of dependence remains aligned with the arrow of relative construction time.
Affects: 2.0 final
The text was updated successfully, but these errors were encountered: