Sorry, last posting did not work well. I repeat..
Hello Ranchers,
Thanks for all of your input.
Can we summarize our discussion in the following way to confirm that the EJBHome is a
Factory Method pattern? Please feel free to correct me if I am wrong.
Summary
EJBHome qualifies to be a Factory Method pattern. As we follow the conventions in GoF Book,
the follwing classes/interfaces take the corresponding roles:
class/interface --------> GoF Convention(pg 108)
EJBHome(interface) --------> Creator
MyBean_HomeImpl(class) -------->ConcreteCreator
EJBObject(interface) --------> Product
MyBean_Impl(class) --------> ConcreteProduct
where MyBean_HomeImpl, MyBean_Impl classes are arbitrary names, and are generated by EJBContainer.
These names vary from one vendor to another.
When a Client invokes create() method using EJBHome reference, home:
the corresponding factory method create() in MyBean_HomeImpl is invoked, and MyBean_HomeImpl
instantiates an instance of MyBean_Impl class. Therefore, remote_ref points to the instance of
MyBean_Impl.
Having brought EJBHome, EJBObject, MyBean_HomeImpl, MyBean_Impl interfaces/classes into the Structure,
how do we bring the Bean class(class implemented by the Developer)into the Struture? The proxy pattern comes in this
regard in the following way:
class/interface --------> GoF Convention(pg 209)
EJBObject(interface)--------> Subject
MyBean_Impl(class) --------> Proxy
MyBean(Bean class) --------> RealSubject
When a Client invokes a business method, getFirstName(), using remote reference, remote_ref:
MyBean_Impl invokes the method implementation of getFirstName() in MyBean class
Thank You
Thambi