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.

Avoid use of anonymous derived types in XML schema definitions<br />

Some XML Schema Definition (XSD) features (restrictions on the primitive string type, for<br />

example) result in modifications to the type that require a new subtype to be generated. If<br />

these types are not explicitly declared, a new subtype (a derived type) is generated at run<br />

time. Performance is generally better if this situation can be avoided. Avoid adding restrictions<br />

to elements of primitive type where possible. If a restriction is unavoidable, consider creating<br />

a new, concrete SimpleType that extends the primitive type to include the restriction. Then<br />

XSD elements might use that type without degraded performance.<br />

Avoid references to elements in one XML schema definition from another<br />

Avoid referencing an element in one XSD from another. For example, if A.xsd defines an<br />

element, AElement (shown in Example 2-1), it might be referenced from another file, B.xsd<br />

(shown in Example 2-2).<br />

Example 2-1 AElement XSD<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

Example 2-2 AElement referenced from another file<br />

<br />

This practice often performs poorly. It is better to define the type concretely and make any<br />

new elements use this type. Thus, A.xsd takes the form shown in Example 2-3.<br />

Example 2-3 AElementType XSD<br />

<br />

<br />

<br />

<br />

<br />

<br />

The form that B.xsd takes is shown in Example 2-4.<br />

Example 2-4 BElement XSD<br />

<br />

Reuse data object type metadata where possible<br />

Within application code, it is common to refer to types, for example, when creating a BO. It is<br />

possible to refer to a BO type by name, for example in the method<br />

DataFactory.create(String URI, String typeName).<br />

You can also refer to the type by a direct reference, such as in the method<br />

DataFactory.create(Type type). In cases where a type is likely to be used more than once,<br />

it is faster to retain the type, for example, through DataObject.getType(), and reuse that type<br />

for future use.<br />

12 <strong>IBM</strong> Business Process Manager V8.0 Performance Tuning and Best Practices

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

Saved successfully!

Ooh no, something went wrong!