• Post Reply Bookmark Topic Watch Topic
  • New Topic

Scope of Context

 
Ram Dhan Yadav K
Ranch Hand
Posts: 321
  • Mark post as helpful
  • send pies
  • 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

 
Rich Raposa
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!