Differences between container and temporary tables and collection classes in dynamics ax

Description:-

Let us look when to use a Container, Temporary Table and Collection Classes

  • Use a container to pass values between the client and server in a single method call and when data/values are few records as values are stored and retrieved in the container sequentially.
  • As I've said earlier containers have performance implications if not used appropriately and this is especially true when there is huge data manipulation in the container because for every X++ container statement new memory is allocated for creating new container object causing the performance bottlenecks.
  • Use Temporary Tables when you handle huge amount of data for faster retrieval because indexes can be setup on the table and also table passing is "Pass by reference" which will give performance boost as only pointer to the object is passed unlike in container new container copy is passed causing memory issues.
  • Use Collection Classes [List, Set, Map, Struct] to store and retrieve not only simple types such as strings and integers, but also more complex types such as records and objects. Dynamics AX collection classes have been designed for storing objects. The classes are implemented in C++ to achieve the maximum performance (they are system classes - MSDN). 

Related Posts

Previous
Next Post »

Thanks for comments.....