Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ejbhome

 
jay roy
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys

does ejbhome object follow factory and singleton pattern? or does it follow only factory pattern?

thanks
Jay
 
Raja Mani
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As for as my knowledge ejbHome is using factory pattern and its not using singleton.
 
jay roy
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for replying raja.

i thought the same but i have a feeling it follows singleton pattern too.
Assuming that there are 1000 users , all those 1000 users accessing the same bean will be using the single instance of the beans' EjbHome object which makes it a singleton pattern.

however , i dont see anywhere in books or website which states that it follows singleton pattern.

so just wanted a confirmation..

thanks
J
 
Roshann Lal
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Even I have the same doubt

Although EJBHome keeps creating different instances, but only one home per bean.
 
Raja Mani
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Me too have joining the queue . :roll:
 
jay roy
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
guys

it does not follow singleton pattern because singleton pattern states that the method should be of type "public static".In the home interface we do not have any methods of type "public static", hence it does not follow singleton pattern ALTHOUGH for a bean only one instance of ejbhome is reused by multiple users.

hope that helps
J
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic