Please see the Q100982 issue for more information.
We have closed this ticket because another page addresses its subject:
Performance - Implement a CollectionSource based on a data view (e.g., XPView, IDataRecord) rather than on a collection of persistent objectsHow to increase performance ( Delayed Loading )?
Answers
Hello Michal,
First, thanks for the sample project.
Let me explain some important issues concerning using delayed loading…
-
The recommended way to declare a delayed property is described in the following help topic in the XPO documentation: Delayed Loading. Take special note of the specific getter and setter of the delayed property.
-
Using delayed properties will have the greatest impact on performance when the property holds large amounts of data (e.g. images, large memos and binary data).
-
There are some cases when using delayed loading may actually decrease performance.
-
The impact on performance (good or bad) depends on the structure of your persistent classes and your data. It also depends on your use cases and scenarios that are produced by your business requirements.
-
We recommend avoiding the use of delay loading for a particular property if you have any doubts about it's suitability for that particular property.
Returning to the sample project:
There is no need to mark the DomainObject2 property of the DomainObject1 class as delayed. In this instance it will be better to use the ExplicitLoadingAttribute, or perhaps create this property using aggregation.
In most cases, if your classes are well-structured, then you will not experience poor performance.
When manipulating large amounts of data you can always enjoy the benefits of the Server Mode. It should deliver good performance.
As for the tricks we performed with your controller (from our previous discussion), we recommend avoiding this until after you have performed a careful profiling. Only after this confirmation can we consider some tricks and actions to optimize the current state of affairs.
Thank you for your patience,
Dennis
Developer Express Support
Hi Dan,
Thank you very much for information. I have found two possible solutions of my problem in suggested issues:
- using XPView class
- using XPCollection.PreFetch() method.
And I have some additional questions:
Ad.1.
How can I use XPView as data source in xaf list views? Could you provide any sample? Is there any possibility to use XPView in Server Mode on list views (XPView as a "server mode" data source of list view - to enable retrieving objects on demand (scrolling in win, paging in web), server side sorting, grouping and filtering)? I think using XPView without server mode (retrieving all objects at once, client side sorting, grouping and filtering) is less efficient than using standard server mode on list views in XAF.
Ad.2.
How can I use prefetching delayed properties when I use standard server mode on list view? Could you provide any sample? Of course I wouldn't like this method to retrieve all delayed objects related to all rows in list view. It should retrieve only these ones related to rows visible currently on list view.
Thanks for any help.
Hello,
We're working on your questions and we will post our resolution as soon as possible. Thank you for your patience. Please bear with us.
Thanks,
Dan.
Hi Michal,
Sorry for a long delay in responding.
- We have added a new suggestion (Performance - Implement a CollectionSource based on a data view (e.g., XPView, IDataRecord) rather than on a collection of persistent objects) to have a new collection source to provide data in the list view based on the XPView. Its correct implementation requires some time. So, we can also point you on to the right direction on how to start implementing this from scratch.
If you can wait, please track the state of this suggestion to be up on. First, I want to warn you that with this kind of collection source we expect that some standard features of an XAF application, like selection and the capability to move between records provided by the corresponding controller, will be lost, but to be sure we need some additional investigation. I look forward to hearing from you. - Samples of pre fetching delayed properties are provided in the issues Dan pointed above. The bad news is that there is a problem when introducing these options in your XAF application due to a specific implementation of providing data to list views in our framework.
The best approach here will be to use the XPView.
Thanks,
Dennis