Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Where should the business logic reside in the beans or in
Seigmund Akinwande Johnson wrote:
>
> I am currently deploying a web based app which requires some business logic
> and database, I would like to know how to determine where the business logic
> resides.
>
> Example
>
> If a customer withdraws more that X amount of dollars from an account insert
> a record which contains
> the customer id and the amount, into another table, this requires calls to
> the database.
>
> Now my question is should I write a stored procedure to do everything in
> one call
> ( hence business logic is in the database) or use Java objects in a
> middleware which will call the stored procedures separately, so the business
> logic is in the stored procedure.
>
> I am completely database oriented and feel strongly about making this in
> one network trip instead of
> having the business logic in the middleware and making 2 separate calls.
>
> --
> Developer
> BSDIS
> 773-834-2652
A major feature of EJB is to permit abstraction of the logic from implementation details. Using stored procedures ties you to a particular (singular or set of) DBMS. You aren't forced to be portable, and can choose between (portable and slightly slower right here) and (fast here and big-budget porting issue for new DBMS). In the spirit of Java, though, I'd encourage portability.
In your case, calling different stored procedures from a bean seems to be an inferior combination of (single stored procedure that calls other procedures) and (all SQL in the bean).
--
Jerome Mrozak
- Sun Certified Java Developer & Programmer -- goose_at_enteract.com -
Received on Thu Nov 04 1999 - 20:03:25 CST
![]() |
![]() |