Reducing the impact of new XML versions
Creating new versions of XML schema definitions can trigger painful, rippling
change. These steps can reduce or eliminate problems caused by inflexible version
We should capture the XML version in our schema. Many mechanisms can
be used to do this, and each approach has strengths and weaknesses.
The important thing to do is to pick an approach for capturing a version
number and stick with it.
We should capture compatible versions in the instance. By explicitly listing
compatible versions of the interface, we avoid guesswork. We explicitly
list compatible versions.
Where possible, we should make compatible changes. We can make added
elements optional, or we can make newly changed types less restrictive
than the original.
Older versions should be available. We can support multiple versions of
the same schema within the same processing application. Within the
same XML application, we can query the version number and process
We should use translation technologies to bridge incompatible XML specifi-
cations. A powerful use of XSLT technology is quick translations
between incompatible types.
These techniques won't necessarily eliminate the changes associated with churn-
ing a major interface. However, they will reduce the impact of any changes.
Summary: Sweetening bitter connections
Many Java programmers and architects understand the importance of a well-
performing connection but fail to consider the costs associated with establish-
ing and terminating connections. In this chapter, we examined antipatterns
related to connection creation and cleanup.
Connection Thrashing is an antipattern that creates and terminates a con-
nection at significant expense, though the connections might easily be
reused with a connection pool. Database administrators have used the con-
nection-pooling concept for years, and the benefits are well documented.
Because the total cost of making and closing a connection can easily
approach fully half of the total cost of a database transaction, this approach
should be near the top of the list of performance enhancements that promise
significant bang for the buck.