david sims wrote:
> > Are there any technical reasons why a Session bean would be preferable in
> > this case?
> in my mind, no. I think it's a misguided notion that entity beans are mere data
> containers and should contain only getter and setter methods. I put actual
> business logic in my entity beans. I find it cumbersome to put business logic
> in a session bean when it makes perfect sense to put it in an entity bean.
In general, I agree as well.
Just to play the other side for a minute, the recommendation for putting
business logic almost exclusively in session beans stems, as far as I
can tell, from the fact that you can have one method in a session bean,
say, performComplexTask(), that calls three or four lower-level methods
on an entity bean in the same transaction. Another way to put this is
that it's quite easy to inadvertently cause zillions of network trips to
happen if you call several methods on an entity bean from the client to
accomplish a task. On the other hand, if you call a single method on a
session bean, then one method invocation request goes across the wire
from the client to the bean, which then typically can converse with the
entity bean in the same container.
For folks who would prefer not to inadvertently stumble into transaction
problems, blindly following the advice to shove all your logic into
session beans can make some sense.
Finally, though, when the so-called "business logic" (I hate that term
with a passion; what if I'm designing a system that doesn't have
anything to do with "business"? :-)) in the entity bean is simple and
relatively atomic and pertains to the bean only, I agree that it seems
like overkill to move this "up" to a session bean.
Ooh, that rambled a bit; time for coffee.
Cheers,
Laird
===========================================================================
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".