Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

using instance variables in Stateless session bean  RSS feed

 
Tausif Khanooni
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys,

I have the following class Instance variables and the method wich is used to create a remote object.



Now my doubt is,
1. I am checking the condition that do i have to really check this or i can simply create the object without checking any condition?

2. Should i use any instance variables in stateless session bean or i must avoid using them?

Thanks for your help in advance
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You "can" use instance variables wherever you want, but clearly "why" you want to do it is the issue you should consider. For initialization concerns, you may want to consider doing it within one of the "lifecycle" methods provided by the SessionBean interface, like setSessionContext.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!