Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Where should business logic be placed?

843830Jul 11 2004 — edited Jul 15 2004
Hi,
this is very controversy where i work, because there are 2 major opinions on this topic.

I'd like to hear others opinions about where should the business logic be placed. First, i'm gonna expose my opinion and Second, i'm going to expose some other guy opinion, so the ranchers can tell wich one they think is better.

Opinion 1 - If a business login belons/affects only one CMP (consequently only the rows of the CMP mapped table), insert this business login inside this CMP (an example would be "fillStock(30)"). But if the business login affects 2 or more CMPs, place this business logic inside a Session Bean between the Fa�ade and CMPs(an example would be transferMoneyFromThisAccountToThatAccount(1, R$30, 2)"). Naturally, for accessing this 2 kind of methods there will be a Session Fa�ade.


Opinion 2 - Always place the business logic inside a CMP, when this logic affects other CMPs, choose the one responsible for the login and place the business methods there. The same way, this logic will be accessed through a Fa�ade.


Well, I'd be very gratefull if people discuss this 2 points of view and tell me (with arguments or an example) why anyone of them is better.

Thanks and Regards,
ltcmelo
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 12 2004
Added on Jul 11 2004
16 comments
563 views