We don't use entity beans :) Kind of avoids their many pitfalls. However,
all data access is handled via stateless session beans - the UI/application
layer only works with "simple" data containers. (However, if I were to use
entity beans, I would hide them behind session beans, and use a business
interface for them as well. No real thoughts on entity bean handlers,
though.)
--jason
-----Original Message-----
From: Deadman, Hal [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 05, 2001 12:00 PM
To: [EMAIL PROTECTED]
Subject: RE: Frames, concurrency, and EJB Stateful Session beans - a
probl em.
I like this. I have seen the business interface idea described before but I
like the handler as a way to hide EJB calls from the front-end code. Do you
typically access entity beans from stateless session beans or do you call
entity beans directly from the front end? Do you have business interfaces
and handler classes for both entity beans and session beans?
>From the original post, why not store state somewhere else besides the
stateful session bean? I haven't run into a reason to use stateful session
beans in a web application where there are plenty of other places to store
state (cookies, session, db). I would be interested to hear when people have
found them to be useful.
Hal
> -----Original Message-----
> From: Jason Pringle [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 05, 2001 2:41 PM
> To: '[EMAIL PROTECTED]'
> Subject: RE: Frames, concurrency, and EJB Stateful Session beans - a
> probl em.
>
>
> I usually try to stay far away from doing lock/unlock type things with
> threaded access - really testing it can get too hairy, and
> problems tend to
> be hard to trace.
>
> The practice we use here for EJBs is thus (it's actually not
> too hard to do,
> and hides the fact that you're using EJBs from the front end).
>
> Ixxx.java - interface defining business methods
> xxxBean.java - implementation code: xxxBean implements
> SessionBean, Ixxx
> xxxHome.java - standard Home interface
> xxxRemote.java - remote interface, extends EJBObject, Ixxx
> xxxHandler.java - wrapper class, implements Ixxx
>
> The JavaBeans (and JSPs in some cases - no, we're not using
> Struts (yet))
> use the xxxHandler classes for all access. The xxxHandler
> actually does to
> the lookup, home create, portable narrow, and delegates all
> calls to the
> EJB. The code is so straightforward it could really be generated (of
> course, we don't do that). Since everything runs off of the
> Ixxx interface,
> the compiler will catch if you change signatures in one place
> and not the
> other. And your Remote interface is empty, since it just "joins" the
> EJBObject and Ixxx interfaces.
>
> Food for thought, there are many other ways to do this.
>
> --jason
>
>