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

Abstract Factory or Factory pattern

 
Shankar Ranganathan
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which pattern is used for EJBHome Interface. I know Factory pattern is definitely used.But I am not sure if Abstract factory is there.Please explain.
 
Rufus BugleWeed
Ranch Hand
Posts: 1551
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you go back in time in this forum this question has been discussed many times. I think EJBHome is a proxy. Others have had other opinions.
 
Kevin Thompson
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a religious question.
Sort of like - "How many angels can dance on the head of a pin"?
It is best not to even think about the religious questions on the SCEA exam. You might be driven insane.
Kevin
 
Thomas Hofmann
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
:roll: Abstract Factory
 
Shankar Ranganathan
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
Abstract factory would be a collection of factory method. To say it is an Abstract Factory pattern it should able to produce different factories.What are the the different factories ejbHOme produce?kindly explain
 
Debanjana Dasgupta
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think Factory.
Please see this thread.
http://www.coderanch.com/t/150355/java-Architect-SCEA/certification/Home-Interface-Abstract-Factory-or
Thanks
Debanjana
 
Shankar Ranganathan
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Debanjana
 
Thomas Hofmann
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think Abstract Factory (actually I'm convinced it is) and I will try to explain, why.
A client first gets a reference to home object which implements the EJBHome interface. This home object is the container (vendor) implementation of the EJBHome interface of the EJB2.0 API (analogous to AbstractFactory).
At deployment the container creates an implementation of your bean's home interface (analogous to ConcreteFactory). This objects (ConcreteFactory) also extends the home object (AbstractFactory). You has to provide a home interface for each EJB (Product). However, the container generates an implementation (ConcreteFactory) for it at deployment. So there are container implementations (ConcreteFactories) for each home interface of the bean provider which eventually create the appropriate bean (Product).
Make this sense ?
Thomas
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic