08.06.2014 Views

Download PDF (1.3 MB) - IBM Redbooks

Download PDF (1.3 MB) - IBM Redbooks

Download PDF (1.3 MB) - IBM Redbooks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Also, avoid constructing trace messages outside of conditional guard statement. For example,<br />

the code in Example 3-1 creates a large string object even if tracing is disabled.<br />

Example 3-1 Creating a large string object<br />

String boTrace = bo.toString();<br />

Although this pattern is always inefficient, it impacts performance even more if the BO size is<br />

large. To avoid unnecessarily creating a BO when tracing is disabled, move the string<br />

construction inside an if statement, as shown here:<br />

if (tracing_on) System.out.println(bo.toString());<br />

Avoiding buffer-doubling code<br />

Study the memory implications of using Java data structures that expand their capacity based<br />

on input (for example, StringBuffer and ByteArrayOutputStream). Such data structures<br />

usually double their capacity when they run out of space. This doubling can produce<br />

significant memory pressure when processing large objects. If possible, always assign an<br />

initial size to such data structures.<br />

3.2.12 Mediation Flow Component considerations<br />

This section describes Mediation Flow Component (MFC) considerations for performance.<br />

Using Extensible Stylesheet Language Transformation (XSLT) primitives<br />

versus business object maps<br />

The XSLT primitive offers two alternate transformation approaches in a mediation flow. If no<br />

XSLT-specific function is required, then it is generally better to use the Business Object Map<br />

primitive, which can be faster. The exception is when a Mediation Flow Component is trivial in<br />

nature and the transformation is taking place at the /body level of the service message object<br />

(SMO). In this case, XSLT is faster because the native XML bytes can be passed straight to<br />

the XSLT engine. Native XML bytes are available if the XSLT transform primitive is the first in<br />

the flow or only preceded by one or more of the following primitives:<br />

► Route on Message Header (Message Filter primitive)<br />

► XSLT primitive (Transforming on /body as the root)<br />

► EndpointLookup without Xpath user properties.<br />

► Event emitter (event header only)<br />

In Business Process Manager 8.0, the Integration Designer enhances the XML Mapper to<br />

use Business Object Maps for more cases, which results in better runtime performance. This<br />

enhancement is described further in the presentation at the following location:<br />

http://publib.boulder.ibm.com/infocenter/ieduasst/v1r1m0/topic/com.ibm.iea.iid/iid<br />

/8.0/EnhancementsOverview/BPM80_IID_Enhancements.pdf<br />

Chapter 3. Development best practices 43

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!