[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-355) Constructor injection of component dependencies

Jeremy Norris (JIRA) jira-events at lists.jboss.org
Thu Dec 18 12:17:54 EST 2008


    [ https://jira.jboss.org/jira/browse/JBSEAM-355?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12443401#action_12443401 ] 

Jeremy Norris commented on JBSEAM-355:
--------------------------------------

Gavin, you mentioned there is a reason why EJB3 doesn't support constructor injection.  What is this reason?  Is it a technical reason?  Interestingly, Apache OpenEJB 3.1 supports constructor injection (http://www.infoq.com/news/2008/11/openejb-3.1-release).

> Constructor injection of component dependencies
> -----------------------------------------------
>
>                 Key: JBSEAM-355
>                 URL: https://jira.jboss.org/jira/browse/JBSEAM-355
>             Project: Seam
>          Issue Type: Feature Request
>          Components: Core
>            Reporter: Christian Bauer
>            Priority: Minor
>
> Take the registration example. The 'user' component is instantiated by Seam when JSF first looks for 'user' in a page. It is then put in the SESSION context (think CONVERSATION for other use cases of what I'm proposing). Seam uses the default constructor to instantiate the component. 
> Now imagine that some attributes of User are immutable and that the only way to set their values is through a different constructor. Also imagine that these values are actually present when Seam instantiates the 'user' component, e.g. in the current CONVERSATION. I'd like to tell Seam to call my constructor and use EL to bind the arguments.
> Without this feature, immutable properties need to have public setter methods that I call later in an action method to wire in the required attributes manually.

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

        



More information about the seam-issues mailing list