Philipe Fajeau wrote:
> What are the implications of using entity beans (versus session beans)
for
> the highest level objects and an O/R mapping tool for the subordonate
> objects? I have read a few times that it is good practice to provide
clients
> access to the entity beans through session beans. I see that as the old
MIS
> way of separating data and behavior and a direct violation of the OO
> approach where data and behavior are modeled in one object. And I am
talking
> about real behavior not just a buch of get and set.
>
> From what I am reading it almost look like to model a real object in EJB
one
> needs two beans: an entity beans (data) and a session bean (behavior).
> Weird...
>
> Could it be the IBM (big MIS shop) influence that led to this framework.
As someone who is at least partially in the "IBM (big MIS shop)" camp, I
understand why you wrote your last sentence but I don't think it's true.
Tom Valesky gave the key reason why it is hard to follow a good OO approach
with EJB. He wrote:
> Could you do the same thing with an enclosing entity bean?
> Sure. I like session beans for this use, though, because
> they're per-client (i.e. not shared among multiple clients),
> so you can stash conversational state info in them if you need to.
The problem is that Entity Beans can't be made to operate on conversational
state info, yet in a typical EJB application <emphasis>the majority of the
behaviour relates to conversational state.</emphasis>
Hence what you are seeing is a re-invention of the big MIS shop design
pattern under EJB, out of necessity, even though, as you say, it is in
direct violation of the OO approach.
This problem will remain with us until a way is found to bind the state of
an Entity Bean to a conversation which, IMHO, needs changes to the EJB
architecture.
Ian McCallion
CICS Business Unit
IBM Hursley
[EMAIL PROTECTED]
Tel: ++44-1962-818065
Fax: ++44-1962-818069
===========================================================================
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".