-
While getting the home interface instance on the client-side, the same instance is returned to all the clients. Generally, we use EJBHomeFactory pattern for this. What if we use the same kind of Factory pattern for Remote Interface?
-
Hi Dhiraj,
the home instance you got is the factory of your remote interface.
and concerning this instance i think that we use the singleton pattern.
BENMIRA Nabil
-
I suppose you could think of the home stub as a proxied singleton proxy factory; i.e. it exposes the contract of a singleton factory to a client; the factory generates proxies (remote stubs) for actual business objects. Note that this doesn't imply the existence of a singleton on the server. It just has to appear like one by means of a proxy (i.e. look up a single proxy in JNDI and use it).
-
Thanks for your replies. My question was can you use singleton pattern for remote interface?
-
Basically no. Remote objects are not singletons and do not contract to be so. However, if you genuinely want a business object to be a singleton, then you can always implement it as an RMI object.