Defining your own data
Use classes for records with fields and methods, and enums for alternatives. Their fields follow the same ownership and cleanup rules as collections.
Heterogeneous collections combines classes and enums in lists and dictionary values, and explains the restrictions on sets and dictionary keys. Special-purpose data structures introduces columnar lists for scanning selected primitive fields.