Home factory pattern

In the EJB programming mode, clients require access to the home interface of EJBs before accessing the EJBs. Therefore, every client is faced with coding the retrieval of home interfaces through the naming service.

The idea of the home factory is to centralize this code and write it only once. EJB clients then use the home factory to access the home of any EJB.


The home factory pattern provides the following benefits:

  • Insulate EJB clients from naming service complexity.

  • Cache naming context creation and EJB home lookup to achieve better performance.

  • Provide an interface for creating remote and local EJB homes without specifying the method used to retrieve the concrete class at runtime.

This pattern is also known ...

Get EJB 2.0 Development with WebSphere Studio Application Developer now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.