-
1. Re: default scope of SFSBs
nickarls Apr 27, 2010 9:49 PM (in response to asookazian)You can probably write an extension for that if you need it.
-
2. Re: default scope of SFSBs
asookazian Apr 27, 2010 10:11 PM (in response to asookazian)But thinking along the lines of
convention over configuration
, why is an extension required? Why can't it be part of CDI/Weld by default? Are SFSBs going to be used as dependent-scoped mostly? -
3. Re: default scope of SFSBs
nickarls Apr 27, 2010 10:20 PM (in response to asookazian)CDI says so (all beans, not just SFSB). Perhaps because it would place the proxying requirements (no-args ctor) on all beans.
-
4. Re: default scope of SFSBs
asookazian Apr 27, 2010 10:27 PM (in response to asookazian)So does this mean SFSBs in Seam 3 will not be conversation-scoped by default??
-
5. Re: default scope of SFSBs
nickarls Apr 28, 2010 8:08 AM (in response to asookazian)I don't know what Pete has planned, I'm just quoting Scripture. Actually SFSB:s are all serializable so that would making them @ConversationScoped by default a bit more straightforward if we go down that path.
-
6. Re: default scope of SFSBs
pmuir Apr 28, 2010 11:51 AM (in response to asookazian)
Arbi Sookazian wrote on Apr 27, 2010 22:27:
So does this mean SFSBs in Seam 3 will not be conversation-scoped by default??No, they will be dependent scoped. This is the most useful and common scope for most beans IMO. Don't forget you have stereotypes too.
-
7. Re: default scope of SFSBs
ruarcoconnell May 5, 2010 9:13 PM (in response to asookazian)
Pete Muir wrote on Apr 28, 2010 11:51:
No, [stateful EJBs] will be dependent scoped. This is the most useful and common scope for most beans IMO. Don't forget you have stereotypes too.Wait... what?! Why would dependent scope be most useful for stateful EJBs? I mean, why make them stateful if you're going to destroy them on the very next evaluation? If @Dependent was the the most common scope we wouldn't be needing contextual dependency injection at all.
-
8. Re: default scope of SFSBs
pmuir May 6, 2010 1:11 PM (in response to asookazian)
Ruarc O'Connell wrote on May 05, 2010 21:13:
Pete Muir wrote on Apr 28, 2010 11:51:
No, [stateful EJBs] will be dependent scoped. This is the most useful and common scope for most beans IMO. Don't forget you have stereotypes too.
Wait... what?! Why would dependent scope be most useful for stateful EJBs? I mean, why make them stateful if you're going to destroy them on the very next evaluation? If @Dependent was the the most common scope we wouldn't be needing contextual dependency injection at all.You're misunderstanding dependent scoped - it means that the dependent scoped bean (BeanA) effectively has the same scope scope as the bean (BeanB) you are injecting it into. For example, say BeanB is request scoped - then BeanA will be destroyed at the end of the request.
My assertion that it is the most useful scope is based on the observation that the number of beans that serve as
endpoints
(e.g. view controllers, remote endpoints etc.) are less than the number of beans that are used for internal services.