November 2019
Beginner to intermediate
674 pages
15h
English
The actual implementation of the TCompanyStorage contains some advanced Delphi techniques that come in handy when you are trying to push the most out of the TDictionary.
Delphi's dictionary implementation TDictionary<K,V> is a generic class, operating on two data types (key K and value V) that are specified when we create a concrete instance of that class. For example, in the Flyweight program, the data is stored in the dictionary class TDictionary<TCompanyInfo, ICompany>, so K is TCompanyInfo and V is ICompany.
The algorithm on which TDictionary is based needs two functions that operate on the K type. One takes two values of that type and compares them for equality, returning Boolean. The other takes ...
Read now
Unlock full access