This is a migrated thread and some comments may be shown as answers.

Using Observablecollection for code generation template

4 Answers 39 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Issam
Top achievements
Rank 1
Issam asked on 01 Oct 2014, 02:07 AM
Hi,

based on this guideline page
http://docs.telerik.com/data-access/developers-guide/code-generation/customizing-code-generation/domain-model/data-access-tasks-customise-code-generation-collection-generation

i changed the code generation template to use ObservableCollection instead of List,
it work for a simple test , the UI is notified correctly after changes, the bound Count property is shown like excpected ... etc .



but i am wondering how this will behave when i go further in developpement in term of performance .
the main question is :
that this change affect the overall application performance, comparing of using the default List or TrackedBindingList for the navigation properties . ?

just curious

thanks and good day !

4 Answers, 1 is accepted

Sort by
0
Kaloyan Nikolov
Telerik team
answered on 06 Oct 2014, 06:28 AM
Hi Issam,

Unfortunately we don't have detailed performance comparison between List and ObservableCollection/TrackedBindingList when used as navigation property.

Potential performance degradation you could expect of the external code listening for the collection change events. If you will operate with with relatively large collections I would suggest your rather to re-bind the entire property instead as in the most of the cases this is faster for the UI. I would suggest you to use TrackedBindingList as we have some known issues with ObservableCollection. Also you can limit its usage only for the navigation properties you use for binding to ensure that the performance is not decreased. 

I hope this helps, should you have any additional questions do not hesitate to get back to us. 

Regards,
Kaloyan Nikolov
Telerik
 
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
 
0
Michael Hafner
Top achievements
Rank 1
answered on 09 Mar 2015, 02:28 PM
Kaloyan,
How would you limit usage to only navigation properties that is used for binding? Is this done somewhere on the EntitesModel.rlinq GUI designer?
Thanks,

Michael
0
Kaloyan Nikolov
Telerik team
answered on 11 Mar 2015, 10:05 AM
Hi Michael,

Unfortunately there is no way to control this from the designer. If you need to do it you should modify a bit the code generation templates. A possible solution could be to list the full name of the properties that should be generated as TrackedBindingList<T> in a file located close to the code generation templates and then read it from the templates and generate the proper type accordingly. 

If you have a client side stand alone application usually it should not cause any performance issues to generate TrackedBindingList for each navigation property. You should pay more attention if the same model will be used server side, as there the performance is more crucial and.

I hope this helps. Should you have any additional questions do not hesitate to get back to us.

Regards,
Kaloyan Nikolov
Telerik
 
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
 
0
Michael Hafner
Top achievements
Rank 1
answered on 11 Mar 2015, 03:06 PM
Yes, it works! Thanks.
Tags
General Discussions
Asked by
Issam
Top achievements
Rank 1
Answers by
Kaloyan Nikolov
Telerik team
Michael Hafner
Top achievements
Rank 1
Share this question
or