• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Where the @NoneScoped can be applied?

 
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Saloon Keeper
Posts: 28807
212
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 28807
212
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know. I don't do Converters as Managed Beans, so I don't scope them, myself.
 
There is no greater crime than stealing somebody's best friend. I miss you tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic