Generics

One of the most powerful concepts in the Object Pascal language is a generic type. This way, we can write our code in a more generic way, so the same algorithm can operate not on just one data type, but many. Generics are things that can be parameterized by type. The code is not fully specified, providing the implementation details to the code that uses generics. There could be generic types where the whole type definition is parameterized by an unknown type, or we can just define generic methods that operate on a type that is not fully specified.

As an example, let's consider a fillable class. Many languages have the concept of nullable values, but we will be different and use "fillable". It seems more natural. One useful example ...

Get Expert Delphi now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.