Hi Nitin,
Probably much of the design strategies can be implemented depending on the
actual requirement and does not relates to any example of sort HireEmployee
Session Bean. But well here are a few suggestions i feel regarding ur
query.
Ur Question was :- It is possible to encapsulate business logic in an EJB
as well as a database
stored procedure. A typical example is
HireEmployee, which can be modelled as a
SessionBean or a DB Procedure. Which one
is preferably and why?
definitely it is possible to encapsulate business logic in an EJB as well
as in a DB stored procedure and i will tell u that the performance speed of
DB procedures is far more than a EJB cause it processes the commands as a
native call to DB. So in complicated Queries with lots of subquery's it is
good to process them in DB procedure only as they are damn fast which u can
never ever think of achieving in a EJB architecture because of the
abstraction present there. But it is still recommended that u should keep
ur Business logic on Servlet's (probably that is what a Session Bean is
actually similar to) .U might wonder why the hell u should do that ,but my
friend it might be required depending upon the actual system architecture u
r using for ur implementation. When designing a good eCom based solution
say u r using a three tier(four tier in EJB's) architecture then my friend
u need to balance the business logic in the middleware and DB. And it
always recommended that u should stress ur DB to it fullest rather than
stressing ur Webserver as u can get the best out of a DB like Oracle when u
use it in stressed conditions.But the question then when to use EJB's is
when u need to handle complex transaction related issues in ur business
logic. In transaction management the true worth of EJB's is comes out(for
which the Java technology was always questioned before the launch of EJB1.0
specs.). It is so easy to handle transactions which requires a lot of care
in writing a DB procedure and u r still not very sure of things, the way
they can happen.
And for question related to Oracle9i i m sorry coz i have not worked on it
nor i have any knowledge to its architecture.
enJoy buddy
pirbhu :-)
===========================================================================
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".