• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Where the @NoneScoped can be applied?

 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
About a good utilization the @NoneScoped, I have seen some developers saying that it is good to put the converter as a ManagedBean, to be able to do Injections.

Is NoneScoped a good scope to use in the Converters to allow the injection?

I saw in this post (http://stackoverflow.com/questions/3086896/what-is-none-scope-bean-and-when-to-use-it) that this scope would be good when used to read faces-config parameters.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17646
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd forgotten there even was such a thing!

The URL you referenced seems to have a good explanation. If you are coding EL and you need the EL to reference a "throwaway" bean that exists only for the duration that that particular EL expression is being evaluated, NoneScoped would be suitable. Not that I've ever needed to do that, but it would allow you to offload complex computations and other data manipulations into Java code instead of doing them in EL - which is both potentially an MVC violation and definitely a to debug,

From that usage, I think I could consider them as a UI equivalent to Session EJBs, only something between stateless and stateful; stateful EJBs would retain scope between uses, whereas the NoneScoped beans would simply be discarded.
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Holloway wrote:I'd forgotten there even was such a thing!

The URL you referenced seems to have a good explanation. If you are coding EL and you need the EL to reference a "throwaway" bean that exists only for the duration that that particular EL expression is being evaluated, NoneScoped would be suitable. Not that I've ever needed to do that, but it would allow you to offload complex computations and other data manipulations into Java code instead of doing them in EL - which is both potentially an MVC violation and definitely a to debug,

From that usage, I think I could consider them as a UI equivalent to Session EJBs, only something between stateless and stateful; stateful EJBs would retain scope between uses, whereas the NoneScoped beans would simply be discarded.
I do think as you, but do you think that would be a good usage to a converter as NoneScoped? Instead the RequestScoped?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17646
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know. I don't do Converters as Managed Beans, so I don't scope them, myself.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic