[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-3262) Allow entity class component to be assigned stateless scope

Pete Muir (JIRA) jira-events at lists.jboss.org
Tue Aug 19 05:53:06 EDT 2008


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

Pete Muir commented on JBSEAM-3262:
-----------------------------------

> In Seam, as it stands now, the stateless scope doesn't store the result. It is an "unscope" because after the creation process happens, it returns the result to the caller and doesn't keep a reference to it. Yes, Seam is contextual by nature, but the stateless scope falls outside of that nature. The API vs implemetnation, of Seam is hard to understand sometimes as we have no spec it is based on.

No, the stateless scope is well defined, no state is held by objects between calls to the object. You are confusing the implementation of the stateless scope and it's semantics.

> Now, do we need what I am asking for? Maybe I am the only person who finds it useful. I'm willing to accept that. 

We all agree, there are valid use cases for this. That's why it is defined in Web Beans, and will be available in Seam 3.

> I completely agree that the stateless scope might not work this way in the future because the idea was perhaps to be more like stateless session beans. In that case, I would be referring to another scope, perhaps something like "prototype" scope in Spring, which, by the way, is exactly like Seam's stateless scope as it stands now.

Seam's stateless scope is semantically identical to the stateless scope in EJB3. It just *isn't implemented* that way currently.

So, you are asking for a new scope. That new scope is the dependent scope, which Web Beans introduces.

As we have a big step change in Seam just around the corner which resolves this issue, introducing anything extra at this stage would just confuse people.

And to go back:

> I don't care if it's consider hackish because the idea works for me.

Which is fine if you are a user, however for it to make its way into core, it must be semantically consistent and correct, otherwise we end up with a big incoherent mess ;-)

> Allow entity class component to be assigned stateless scope
> -----------------------------------------------------------
>
>                 Key: JBSEAM-3262
>                 URL: https://jira.jboss.org/jira/browse/JBSEAM-3262
>             Project: Seam
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.3.CR1, 2.1.0.A1
>            Reporter: Dan Allen
>            Assignee: Pete Muir
>            Priority: Minor
>             Fix For: 2.0.3.GA, 2.1.0.GA
>
>         Attachments: JBSEAM-3262-branch20.txt, JBSEAM-3262-trunk.txt
>
>   Original Estimate: 5 minutes
>  Remaining Estimate: 5 minutes
>
> There is no reason for not allowing an entity class component to be assigned to the stateless context like JavaBean and stateless session bean components. In fact, you could argue that there is no difference between a JavaBean and an entity class based on the fact that they are both vanilla Java classes.
> There is a perfect use case for this feature that comes right from the heart of Seam. When using the Home component, it is perfectly natural to create a component role for an entity class that is wired to the newInstance property to be used as a prototype. For instance, here is an example:
> <component name="roundPrototype" class="org.open18.model.Round" scope="stateless">
>     <property name="golfer">#{currentGolfer}</property>
>     <property name="date">#{currentDate}</property>
> </component>
> <framework:entity-home name="roundHome" class="org.open18.action.RoundHome" new-instance="#{roundPrototype}"/>
> You don't want the roundPrototype to be stored in a scope since it is only used internally to produce the instance managed by the roundHome component. However, with this configuration, Seam throws an exception at startup.

-- 
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