Enumerations, collections, and lists
I have used the term collection quite a few times already but I (quite intentionally) “forgot” to define this quite a loose term. Let’s fix this now.
We will define a collection as a bunch of data items of the same type combined with some kind of an API that allows us to access (read, write, and delete) those data items in an organized manner. Collections can be further classified by the API they provide (we’ll return to that in a moment). Delphi’s TList
, for example, is a collection (more specifically, a list) of pointers and TList<T>
is a collection of items of type T
.
Spring collections are implemented using interfaces (an API from the previous paragraph is Delphi’s interface). The core of Spring collections is built on generic types and interfaces, which are carefully crafted so that they don’t result in slow compilation times and EXE bloat when you are using generic collections of...