Java Reference
In-Depth Information
S
YMPTOMS
,
CONSEQUENCES
:
Repeated delivery of software with poor
performance; performance-tuning activities that are unfocused and inef-
fective; inability of low-level developers to articulate the performance
requirements for a component they're building.
Round-tripping
R
ELATED
ANTIPATTERNS
:
The Cacheless Cow. Some specializations of
this antipattern exist. The lack of a cache can also cause round-tripping.
D
ESCRIPTION
:
Round-tripping occurs when a chatty interface falls on a
major interface boundary, such as a distributed interface. For
EJB
s, a cli-
ent (usually a controller or
JSP
) accesses the remote interface of a distrib-
uted entity bean. Since an entity bean usually exposes many fields and
sometimes collections, this results in many round-trip communications,
absolutely murdering performance.
M
OST
FREQUENT
SCALE
:
Application.
R
EFACTORED
SOLUTION
NAME
:
The Facade.
R
EFACTORED
SOLUTION
TYPE
:
Software.
R
EFACTORED
SOLUTION
DESCRIPTION
:
The most common solution to
this problem is the facade. This interface is implemented with a distrib-
uted call, such as a session bean. The interface combines many chatty
communications into a single, consolidated call.
T
YPICAL
CAUSES
:
A common cause is the use of major frameworks, such
as
EJB
s, near interface boundaries without modification.
S
YMPTOMS
,
CONSEQUENCES
:
Applications are slow.
A
LTERNATIVE
SOLUTIONS
:
The distributed command can also be used to
control round-tripping. In addition, refactoring can frequently shift an
interface so that logical tasks are grouped into a single physical round-trip.
Other alternatives can help performance. A cache can help after the first
load. (Often, both a cache and facade are desired.) The
EJB
can also be
deployed on the same box, though many times, strong reasons motivate
separation.
Bad Workload Management
D
ESCRIPTION
:
Poor distribution of work occurs when one server of a
cluster receives a disproportionate share of the work.
M
OST
FREQUENT
SCALE
:
System.