|
Here's
what Brett has to say on the subject (briefly):
"...While stateful beans can be helpful for processes
or tasks that span multiple requests, they are often slower and obviously
require more memory in the virtual machine. Stateless session beans,
though, are very fast, and often only a few instances are needed to serve
hundreds of requests. These qualities make them ideal for most business
tasks, and preferable for better application performance.
"...First, unless there is a reason not
(emphasis in original) to use stateless session beans, you should use
them. Using stateless beans over stateful ones in the general case can
drastically increase application performance. Because the EJB container
can share stateless session bean instances across all EJB clients, it can
maximize performance, as well as cache the instances in some
cases.
"...Finally,...(A)lthough the bean doesn't persist
across requests, it can be used multiple times over one request and bean
lookup. For this reason, multiple methods that operate on the same logical
data can be consolidated into a single bean. This can really clean up code
and clarify what different components are used for.
"...I've emphasized this quite a bit, but I'll say once
more that you don't want to use stateful session beans for many of [your]
business processes...."
Java Enterprise Applications, Volume I:
Architecture, pp. 22-23.
Further, Sasha Nikolic doesn't even discuss
stateful session beans, recommending that for most uses, a session façade using
stateless session beans or a singleton cache (possible using a HashMap) are the
preferred methodologies.
Java Enterprise Best Practices (O'Reilly 2003):
7-31, esp., 10-13 and 22-24.
As for
Brett's experience, he's "been working in computers since the Logo days.... He
has spent the last several years implementing [Java-based application
infrastructures] at Nextel Communications and Allegiance Telecom, Inc.
Brett is one of the cofounders of the Java Apache project Turbine.... He
is also a contributor to the EJBoss project...and Cocoon.... His projects
all focus on using XML and the J2EE platform in mission-critical,
high-performance, distributed systems. Together with Jason Hunter, he has
defined the JDOM API....
Java Enterprise Best Practices (O'Reilly 2003):
Chapter 5 and p. 266.
Brett also defined the Struts framework and is
presently lead architect for the Apache Tomcat
project.
Mark
=========================================================================== 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".
|
- Mainitaining Session in Application Server Saidas Kottawar
- Re: Mainitaining Session in Application Server Kumar.K.R
- Re: Mainitaining Session in Application Server Mark Galbreath
- Re: Mainitaining Session in Application Se... Victor Langelo
- Re: Mainitaining Session in Applicatio... Mark Galbreath
- Re: Mainitaining Session in Appli... Victor Langelo
- Re: Maintaining Session in Ap... Mark Galbreath
- Re: Maintaining Session i... Juan Pablo Lorandi
- Re: Mainitaining Session in A... Kumar.K.R
- Re: Mainitaining Session in Application Server Saravana
- Re: Mainitaining Session in Application Server Aashish Kaushik
- Re: Mainitaining Session in Application Server Saidas Kottawar
- Re: Mainitaining Session in Application Server Juan Pablo Lorandi
- Re: Mainitaining Session in Application Server Saidas Kottawar
- Re: Mainitaining Session in Application Server Zerbe John W
- Re: Mainitaining Session in Application Server Jason Reynolds
- Re: Mainitaining Session in Application Server Nati Shalom
