[ http://jira.jboss.com/jira/browse/JBSE
AM-265?page=comments#action_12357721 ]
Bruno E. Grossi commented on JBSEAM-265:
----------------------------------------
It can be interesting in constructors, or create methods
(and other methods called by seam, and not by programmer),
to access other components in that restricted scope avoiding
the long time association and use of those other
components.
Example:
Name("important")
Scope(ScopeType.CONVERSATION)
public class MyMostImportantComponent {
In(value="componentUsedOnlyToCreate",
scope=ScopeType.EVENT)
private ComponentTwo componentTwo;
Create
public void init() {
//unique location where ComponentTwo is used
}
}
That code causes instanciation of ComponentTwo for every
request/event of a conversation that use
MyMostImportantComponent, but this is only necessary for the
creation of this second.
With this new feature, we can use:
Name("important")
Scope(ScopeType.CONVERSATION)
public class MyMostImportantComponent {
Create
public void init( In(value="componentUsedOnlyToCreate",
scope=ScopeType.EVENT) ComponentTwo componentTwo) {
//use of componentTwo
}
}
> Inject via method parameters
> ----------------------------
>
> Key: JBSEAM-265
> URL: http://j
ira.jboss.com/jira/browse/JBSEAM-265
> Project: JBoss Seam
> Issue Type: Feature Request
> Components: Core
> Reporter: Gavin King
> Assigned To: Gavin King
>
> public void login( In("user") User user) {
> ...
> }
> is ugly, but we should support it anyway.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the
administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atl
assian.com/software/jira
_______________________________________________
jbossseam-issues mailing list
jbossseam-issues lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jbossseam-issu
es
|