automatically create scope-proxy for conversation beans
-------------------------------------------------------
Key: ORCHESTRA-10
URL: https://issues.apache.org/jira/browse/ORCHESTRA-10
Project: MyFaces Orchestra
Issue Type: New Feature
Components: Conversation
Affects Versions: 1.1
Reporter: Simon Kitching
Assignee: Simon Kitching
Currently, orchestra docs recommend that every conversation-scoped bean include
an <aop:scoped-proxy> tag, in order to avoid "stale reference" type issues.
Adding the aop:scoped-proxy tags manually is a nuisance to do, however.
Instead, it would be nicer for orchestra to automatically create the proxy
object for its beans.
There is a performance hit for beans that are wrapped; every reference to a
method of a "scope proxy" object will look up the bean from the conversation
again. However:
* when EL is being used (the vast majority of cases) the performance hit is
not relevant.
* When a conversation bean passes "this" to other beans, the scope proxy is
not passed, so there is no performance hit on method invocations on the
resulting reference (though the receiver should not hold on to the ref too
long, or stale object problems may occur).
* In cases where spring is used to inject conversation-bean A into another
bean B, then B invokes A multiple times eg in a loop then there is a valid
performance hit. This is probably a very rare situation though.
And doing the wrapping (at least by default) avoids a number of situations
where users can be bitten by "stale object" bugs.
In addition, creating a custom proxy rather than reusing the aop:scoped-proxy
provides some opportunities for performance optimisations.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.