Working with Indirection

Using indirection objects can improve the performance of TopLink object relationships. An indirection object takes the place of an application object so that the application object is not read from the database until it is needed (as shown in Figure 5-4).

Figure 5-4 TopLink indirection

This figure shows the difference in flow when using indirection.
With Indirection Off:
  Flow from source to collection to target
With Indirection On:
  Flow from source to indirection to collection to target

Without indirection, when TopLink retrieves a persistent object, it also retrieves all the objects referenced by that object. This can result in lower performance for some applications. Using indirection allows TopLink to create "stand-ins" for related objects, resulting in significant performance improvements, especially when the application is interested only in the contents of the retrieved object rather than the objects to which it is related.


Related Topics

About TopLink Descriptors
Understanding Indirection
Working with Transparent Indirection
Working with Proxy Indirection

Using Value Holder Indirection
Specifying Indirection
Changing Java Classes to Use Indirection
Specifying Transparent Indirection
Implementing Proxy Indirection in Java

 

Copyright © 1997, 2004, Oracle. All rights reserved.