Slide 35
Slide 35 text
Separate type inspection from execution
RTTI data inspection during an Invoke is wrong on many levels:
● Will be executed multiple time (RTTI is fast enough, but still…),
● Often will be too late: context can depend on previous call,
● It is a bit too late to learn that something is missing or wrong,
Instead:
● Inspect type once, preferably before instantiation,
● Raise inspection errors, log warnings and information,
● Cache results in some structure and just serve it,
● Every new instance will be fully operational instantly,
● Bonus: they won’t need generics and maybe even PTypeInfo.