You cannot do this directly with the EJB spec. If you need to use a generic factory 
interface
in your app, you will need to layer some framework on top of the EJB home interface.

Vlada

----- Original Message -----
From: Mario de Sa Vera <[EMAIL PROTECTED]>
To: Vlada Matena <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, January 19, 2000 10:42 AM
Subject: Re: EJBHome create method


> Ok Vlada,
>
>          I think now we are on the same page... the problem I am having is
> due to this phrase :
>
>          "methods of the home interface are defined as type-specific, not
> generic"
>
>                                                                          Vlada.
>
>          What I am trying to do is having a call to create on a generic
> Home Interface and unfortunately
> I think this will not be possible... at least I can't seem to find a
> reasonable implementation for that :
>
>          EJBObject _genericSkel = _genericHome.create(_genericPk);
>
>          THERE IS NO WAY TO CREATE AN INTERFACE CALLED GENERICHOME THAT
> WOULD HAVE
> A CREATE METHOD BECAUSE THE REMOTE INTERFACE TYPE IS STILL NOT DEFINED !!!
>
> Do you see any solution for that... I think it could be very useful...
>
> thanks a lot and if you still don't understand my question please feel free
> to give me a call ... I'd appreciate
> it !
>
>
>
>
>
> At 10:18 AM 1/19/00 -0800, you wrote:
> >I misunderstood your question. I still don't fully understand what you are
> >trying to accomplish.
> >Could you send a more specific example using the late binding technique?
> >Perhaps we
> >can figure out a solution that would work with you within the spec
> >constraints.
> >
> >Note that we wanted to make the home interface type-safe. Therefore, the
> >create and finder
> >methods of the home interface are defined as type-specific, not generic.
> >The other reason
> >why we wanted the methods to return the exact type was to avoid the client
> >to perform
> >the PortableRemoteObject.narrow operation.
> >
> >Vlada
> >
> >----- Original Message -----
> >From: Mario de Sa Vera <[EMAIL PROTECTED]>
> >To: Vlada Matena <[EMAIL PROTECTED]>
> >Sent: Wednesday, January 19, 2000 9:18 AM
> >Subject: Re: EJBHome create method
> >
> >
> > > Thanks Vlada for the prompt response...
> > >
> > >          Are you sure Vlada  ? I think the EJB specification REQUIRES
> > that the
> > > return type for the create method from the Home Interface HAS TO BE THE
> > > REMOTE INTERFACE type and not a generic type like EJBObject... this is
> > > exactly the problem I am facing... this is bringing me a huge problem
> > because
> > > as we know this implementation would be ideal and very standard in terms of
> > > Object Oriented design ... I am using a generic implementation that at
> > run time
> > > will be replaced by a specific implementation of this generic class
> > (classic
> > > late binding) but the problem is that the EJBHome specification as I said
> > > before
> > > does not have a generic create method implementation and if I create
> > one there
> > > is no way for it to work because I can't predefine the Remote Interface
> > return
> > > type do you understand ?
> > >
> > > thanks again.
> > >
> > >
> > >
> > > At 08:50 AM 1/19/00 -0800, you wrote:
> > > >You can define the generic create(Serializable pkey) method in the home
> > > >interface,
> > > >and the corresponding ejbCreate(Serializable pkey) method in the bean
> > class.
> > > >
> > > >Vlada
> > > >
> > > >----- Original Message -----
> > > >From: Mario de Sa Vera <[EMAIL PROTECTED]>
> > > >To: <[EMAIL PROTECTED]>
> > > >Sent: Wednesday, January 19, 2000 7:45 AM
> > > >Subject: EJBHome create method
> > > >
> > > >
> > > > > Hello guys,
> > > > >
> > > > >
> > > > > I've being involved on a couple of projects using EJB since last
> > year and
> > > > > for the first
> > > > > time I find myself facing a wall that will be very hard for me to
> > overcome
> > > > > it. May be you could
> > > > > help me out either by answering me or sending me a EJB list group
> > to help
> > > > > me out somehow...
> > > > >
> > > > > EJBHome does not define a generic create method although the EJB
> > compiler
> > > > > requires (to
> > > > > a certain extent) that you define one and once you define one create
> > > > method
> > > > > at your home
> > > > > interface it checks if you defined a correspondent method at the Bean
> > > > class
> > > > > (ejbCreate). This
> > > > > scenario works fine if you already know in advance the Remote Interface
> > > > > class because that
> > > > > way you can define create methods from your home interface
> > returning the
> > > > > already known type
> > > > >   of the Remote Interface...
> > > > >
> > > > > The problem I am facing is that I want to have a late binding Remote
> > > > > Interface creation which
> > > > > will require a generic Home Interface that defines a generic create
> > method
> > > > > but the specification does
> > > > > not allow me to do that because there is no generic create method
> > at the
> > > > > EJBHome like :
> > > > >
> > > > > EJBObject create(EJBPrimaryKey) // I am going further with the
> > > > > specification this is only a suggestion.
> > > > >
> > > > >
> > > > > Will I have to simulate an Entity Bean using Session Beans ?
> > > > >
> > > > > thanks.
> > > > >
> > > > >
> > > > > Mario de Sa Vera
> > > > > Applications Engineer
> > > > > 161 Maiden Lane
> > > > > New York City 10038
> > > > > (212) 487-7400
> > > > >
> > >
> > >
>
> Mario de Sa Vera
> Applications Engineer
> 161 Maiden Lane
> New York City 10038
> (212) 487-7400
>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to