EJBs are a portable way to implement your business logic, the second
tier between the front end and back end. You may want to use EJB to
replace existing business logic, or simply to componentize it.
Transactions and security are part of the J2EE architecture and are also
available to Servlets and even client applications.
In a shopping site, you will typically use EJB for the purchase process
(order, payment, inventory, etc), the business logic that works the same
way whether you are using Servlets, or performing nightly batch
operations.
For managing the shopping cart, you might consider writing the code
directly into Servlets. It would make sense considering how shooping
carts are generally designed to address the Web based interface.
arkin
Ahi Satapathy wrote:
>
> So when EJB should be used ? what should be the factor one should consider
> before going to implement something with EJB ? If the site is not
> transactional, has no authorization security needs, and is read only, should
> one go for simple Java Objects and use Servlets with direct JDBC access ??
>
> -- Ahimanikya
>
> > -----Original Message-----
> > From: A mailing list for Enterprise JavaBeans development
> > [mailto:[EMAIL PROTECTED]]On Behalf Of Richard Monson-Haefel
> > Sent: Thursday, February 17, 2000 6:09 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: Session EJBs vs. Java Objects
> >
> >
> > Assaf Arkin wrote:
> >
> > > EJB is pretty much your Java objects + RMI/IIOP + some EJB logic. That
> > > means you can expect it to be slower that plain Java objects.
> > >
> > > Even if you do not perform the a remote method invocation, still EJB
> > > needs to deal with method parameters and return type through
> > > marshalling, which is dead slow on some JVMs. (On my machine everything
> > > slows down to 25%).
> > >
> > > The Servlet 2.3 API supports the same transactions and JDBC connection
> > > pooling that is available for EJB, so if that's all you're looking for,
> > > consider running your database access from the Servlet itself.
> > >
> > > arkin
> > >
> >
> > Before EJB was officially announced, back in the fall of 1997, I
> > developed a site for
> > a major cruise line that used Servlets 1.0 and direct JDBC access
> > through a facade of
> > Java Business Objects. It is quite fast because data access is
> > direct, and flexible
> > because the business object allowed me to assemble solutions
> > easily. This site is not
> > transactional, has no authorization security needs, and is read
> > only. It has been
> > running for three years with little or no modification and its
> > still going strong. A
> > clear case for using Servlets with direct JDBC access instead of EJB.
> >
> > --
> > Author of Enterprise JavaBeans
> > Published by O'Reilly & Associates
> >
> > EJB FAQ
> > http://www.jguru.com/faq/EJB
> >
> > EJBNow.com
> > http://www.ejbnow.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".
> >
>
> ===========================================================================
> 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".