AXForum  
Вернуться   AXForum > Microsoft Dynamics CRM > Dynamics CRM: Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 05.04.2011, 17:18   #1  
Blog bot is offline
Blog bot
Участник
 
25,644 / 848 (80) +++++++
Регистрация: 28.10.2006
Remember my post about ".Net Interop: using Arrays and Collections" (not too long ago)? Well, almost immediately i got a comment from Freddy (Kristiansen) explaining that the Dictionary that I used, is actually quite an expensive one.. . It actually uses two collections (one for the key to find the Index, second for the value with that index), which causes for overhead in case you don't actually need it for your software. When using arrays for lots of data, you might want to consider to use Lists or ArrayLists instead.. .

In both cases, the code looks alike .. . Something like this for Lists:



And this for ArrayLists:



Quite identical, isn't it?

The big difference when using these in stead of using a dictionary is the fact that you're using a real index as key (and not a definable index as in a dictionary).

But what is the difference between a List and an ArrayList?

I'm actually not sure it makes big of a difference for AL developers like us. In C#, this would be the explanation:
  • ArrayList stores everything as an object, and when you retrieve the value you have to cast it back into the actual object type if you want to use any of the objects methods, etc.
  • List is a generic container type that you specify what type it can hold when you instantiate the List<T>. You don't have to cast the object back into the type.
I hope this is sufficient for an explanation. If you have something to contribute .. please feel free to drop a comment!



Читать дальше
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 


Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 09:53.