For our ORM, we needed a class variable to be available for each
TSQLRecord class type.
This variable is used to store the properties of this class type, i.e. the
database Table properties (e.g. table and column names and types) associated
with a particular TSQLRecord class, from which all our ORM objects
inherit.
The class var statement was not enough for us:
- It's not available on earlier Delphi versions, and we try to have our
framework work with Delphi 6-7 up to XE;
- This class var instance will be shared by all classes inheriting
from the class where it is defined - and we need ONE instance PER class type,
not ONE instance for ALL
We needed to find another way to implement this class variable.
An unused VMT slot in the class type description was identified, then each class definition was patched in the process memory to contain our class variable.
