• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Factory Pattern

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all
In ejb ,home interface acts as a factory to create ejbobjects ...huv..
huv it implements the decoupling ...
thanks
priya
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't understand the question. Could you please elaborate?
 
priya shankar
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ilja
I mean that , Ejb home object is factory for creating EJBObjects ....huv it is?
priya
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
EJBHome is a factory because it's managing the creation of EJBObjects. I.e. you don't say "new MySessionBean()" but call a factory method called "EJBHome.create(...)".
 
priya shankar
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks
But what makes EjbHome to act as Factory ....A factory should allow its subclasse to create instances...
where it happens ..
priya
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

But what makes EjbHome to act as Factory ....A factory should allow its subclasse to create instances...


The intent of the GoF pattern "Factory Method":
Define an interface for creating an object, but let subclasses decide which class to instantiate.
"Define an interface" has been fulfilled with javax.ejb.EJBHome.
"let subclasses decide which class to instantiate" is fulfilled by the container generating vendor-specific decorating classes of the EJBHome interface specified by the bean developer, such as com.foobar.MySessionHome_impl for a home interface called com.foobar.MySessionHome.
 
They worship nothing. They say it's because nothing is worth fighting for. Like this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic