Win a copy of Spring Boot in Practice this week in the Spring forum!
  • 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
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Scope of Context

 
Ranch Hand
Posts: 321
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Just wondering is there any restriction on the scope of
SessionContext and EntityContext variable.
What i mean is can we declare them as private/protected/public
what difference does that make?
thanks,
Ramdhan YK

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is no restriction in the EJB spec regarding the scope of the context fields. They can be declared with any of the four different levels of scope.
I really don't know why it would matter what the scope is. It's pretty rare that another Java object will have a reference to a bean object directly. (In most cases, beans are only accessed through their remote or local interfaces, making the access of fields irrelevant.)
Rich

Originally posted by Ramdhan Kotamaraja:
Hi,
Just wondering is there any restriction on the scope of
SessionContext and EntityContext variable.
What i mean is can we declare them as private/protected/public
what difference does that make?
thanks,
Ramdhan YK


 
Ram Dhan Yadav K
Ranch Hand
Posts: 321
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Rich,
I was just thinking about some thing and this dboubt came to my niand and i thought of clarifying it. thats it.
Ramdhan YK
reply
    Bookmark Topic Watch Topic
  • New Topic