
Explore the Delphi generic collections and the junior collections library, praised as one of the best recent additions, and discover why it’s the most complete tutorial on the collections unit.
Explore Delphi generic stacks and compare non-generic versus generic implementations, mastering push, pop, and extract operations while examining memory management, ownership, and type safety for object handling.
Explore how queues implement first in first out behavior, compare non-generic and generic versions, and illustrate enqueue and dequeue operations and type-safety considerations.
Explore Delphi generic collections with lists and queues, adding, printing, and iterating items. Understand items, capacity, and key operations: sort, binary search, remove, insert, and trim excess.
Learn to sort Delphi generic collections and lists using a comparator for event objects. Manage memory with an owning object list and sort by location or date.
Explore how Delphi generic dictionaries store key-value pairs, manage hash tables, and perform add, remove, extract, and contains key/value checks with custom equality.
Explore TArray in Delphi's generic collections, showing assignment compatibility between arrays, dynamic array semantics, and practical uses of copy, sort, find, and binary search on arrays.
Explore assignment compatibility in generics, explain covariant and contravariant, and illustrate with dog list and animal list, highlighting when type mismatches cause runtime errors and why some languages support covariance.
Demonstrates thread safe collections by using locks and monitors to protect internal lists and queues. Learn how T-3 list and T-3 queue implement synchronization for producer and consumer threads.
Watch this video to learn a lot and start making better use of Delphi generic collections within your application.
The Generic Collections Library is one of the best additions to the Delphi RTL. With it, you can get type safety on your containers without having to write a bunch of boilerplate code each time. This can represent a significant reduction in the amount of code you need to write and reduce bugs. Learn how to make the best use of this library and take advantage of some of its more powerful features.
This video covers all the containers available in the collections library and gives an in-depth account of most of their capabilities. You will learn about the basic containers (TStack, TQueue and TList), covering their basic features (adding, moving, removing, etc.). Then, more advanced topics such as how the internals of sorting work. Then we move on to TDictionary and how hashing works, and how you can provide custom hashing mechanisms to change its default behaviour. Finally, we look at the thread-safe collections and how they can be used in multi-threaded code.
With your new knowledge of the Generic Collections Library, your code will be cleaner and more concise, while simultaneously having better compile-time type checking - what could possibly be more fun?
By the end, you’ll code smarter—not harder—with better structure, safety, and performance baked into your projects.