Chapter 1: X++ Unit Test Framework
Chapter 2: Working with Data
Chapter 3: Classes
Chapter 4: Forms
Chapter 5: Visual Studio Integration
Chapter 6: Workflow
Lesson 1 : Collection Classes
X++ contains two compound data types: arrays and containers. They are useful for aggregating values of simpler data types. However, you cannot store objects in arrays or containers. The Microsoft Dynamics AX collection classes have been designed for storing objects.
The following collection classes are available:
The following are aggregating data:
We cannot store objects in arrays (x++ class) or containers. In AX it has been designed for storing objects.
Below are Set , Map , List , Array
A Set is used for the storage and retrieval of data from a collections in which the members are unique. The values of the members serve as the key according to which the data is automatically ordered. Thus, it differs from a List where the members are placed into a specific position, and not ordered Automatically by their value.
The collection classes are shown in the following table.
|Array||Similar to the X++ language array type except that it can hold values of any single type, including objects and records. Objects are accessed in a specific order.
For more information, see X++, C# Comparison: Array Syntax.
|List||Contains elements that are accessed sequentially.
Unlike the Array class, the List class provides an addStart method.
As with the Set class, the List class provides methods getEnumerator and getIterator. You can use an iterator to insert and delete items from a List object.
|Map||Associates a key value with another value.|
|Set||Holds values of any single type. Values are not stored in the sequence they are added. Instead, the Set object stores them in a manner that optimizes performance for the in method.
When you add a value to a Set object which is already storing that same value, the add attempt is ignored by the Set object.
Unlike the Array class, the Set class provides the methods in and remove.
|Struct||Can contain values of more than one type. Used to group information about a specific entity.|