This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Kubernetes in Action and have Marko Luksa on-line!
See this thread for details.
Win a copy of Kubernetes in Action this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ejbhome  RSS feed

 
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
 
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
 
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
Boost this thread!