That's completely incorrect. What's the difference ?
A stored procedure still effects the same SQL against
the database to achieve the same
create/read/update/delete process that embedded or
dynamic sql can achieve. In many respects, you can
achieve better abstraction and data encapsulation
using SPs.

Consider an Oracle PL/SQL package that has
CREATE/READ/UPDATE/DELETE procedures. (And maybe a few
custom finders to boot). Now write an entity bean to
map that package. As far as the Entity is concerned,
it's the same deal. You have a table (the package),
you have a primary key, you have managed fields (the
parameters to the procedures) and you can even have
finders. What's the underlying table structure ? Who
cares ? It's all implemented in the package. You can
do all sorts of interesting things in the PL/SQL. For
example, your DELETE procedure can effect a logical
delete, rather than a deletion of the row. You can
hide all sorts of proprietary Oracle performance
enhancements  in the SQL inside the procedures which
may be difficult or impossible to embedd in a CMP
descriptor. Just because most vendors do not implement
it that way, does not mean it cannot be done that way.

Also, by my measure, it is far easier to modify,
maintain and redeploy a PL/SQL package than an Entity
EJB.

SPs are ISOMORPHIC to standard SQL. They are
abstracted in JBDC (CallableStatement) just like
regular statements. It is simply the invocation
pattern that is different, but this does not render
them incompatible and does not make you loose any "OOP
edge".

(whew)

//Nicholas

--- Sameer Bha
rdwaj <[EMAIL PROTECTED]> wrote:
> by using stored procedures u'll lose all the
> benefits that object oriented
> language like java can offer .
>
> sameer
>
> -----Original Message-----
> From: Vikram Naik [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 16, 2002 3:23 PM
> To: [EMAIL PROTECTED]
> Subject: Why Ejb?
>
>
> Hello All,
>
> Why should we opt of EjBs when stored procedures can
> give us better
> performance?
>
> Your opinions will be highly appreciated.
>
> Thanks & Regards,
> Vikram Naik
>
>
===========================================================================
> 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".
>


=====
Nicholas Whitehead
Home: (973) 377 9335
Cell: (201) 615 2716
Work: (212) 622 5639
[EMAIL PROTECTED]

__________________________________________________
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com

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