Hello, Steve.

Business logic belongs in both entity beans and session beans.  Business logic
related to a particular entity should be encapsulated in entity bean business
methods.  As for business logic which belongs in session beans, such logic is
not particularly well placed within any entity bean.  Such logic typically is
related to a business "process", and is therefore appropriately placed in a
"session" bean.

Business logic appropriately placed in a session bean if often misappropriately
placed outside of any business conceptualizations and left intermingled with
application logic.  Then, as business processes change, application code
unfortunately must be changed accordingly.

For a fuller discussion take a look at pages 38-41 of Richard Monson-Haefel's
"Enterprise Java Beans" book.

Regards,

--Chad

Steve Roth wrote:

> We're trying to identify the appropriate location in an EJB design for
> placing lower-level business logic.
>
> Reading various books and specs (J2EE) often leaves the impression that
> business logic goes in Session beans and Entity beans are for persistence
> only.
>
> For high-level business logic affecting multiple persistence tables, I can
> see this point.
>
> However, what about for business logic tied directly to a single table?  For
> example, a PurchaseOrder Entity bean might expose a number of business
> methods.
>
> Are there any technical reasons why a Session bean would be preferable in
> this case?  (BTW-- we're using BMP for the Entity beans)
>
> Thanks!
> -Steve Roth, [EMAIL PROTECTED]
>
> ===========================================================================
> 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".

===========================================================================
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