One of the more challenging aspects of writing remote applications is partioning requests for data into smaller chunks so that you get quicker startup time. One technique to accomplish this is to load only the parts of your data set that need to be loaded. Let the user choose which subsets of data are subsequently loaded through navigation operations.
Flex Data Management Services provides two techniques for implementing this pattern. When you execute a fill method to retrieve a list of objects from the server, you can enable paging so that only the first page is retrieved as the result for the fill request. As you access items that are not yet loaded, the page containing those items is loaded automatically.
An attempt to access an item which is not yet loaded will throw an ItemPendingError exception, which contains a responder you use as notification when the data is available. At that point, your call just succeeds. If you use data binding to access your managed items, these ItemPendingError exceptions are handled automatically with no additional work on your part. For example, you could enable paging in the mini-contact sample by simply modifying the configuration of the contact destination.
Data Management Services also provides load-on-demand behavior as an option for managed associations. When you set lazy="true" on the association tag, the value of that association is loaded the first time it is accessed by the client application code. When the referencing object is serialized from the server to the client, only the IDs of the referenced objects are passed. If that item is already on the client, the reference is made immediately. If not, the first time the item is referenced, the ItemPendingError exception is thrown and the item is automatically requested from the server. This behavior is automatically added as part of the implementation for your property when processing the code generation that is part of the [Managed] tag.