Quantcast
Channel: Delphi – The Wiert Corner – irregular stream of stuff
Viewing all articles
Browse latest Browse all 1440

Delphi TVirtualMethodInterceptor like magic: some links of useful stuff made with it

$
0
0

I think TVirtualMethodInterceptor is a really nice things added to Delphi XE: it allows you to overwrite virtual methods of a class.

Since the documentation from that era cannot be saved in the WayBack machine, here is some more recent documentation:

Over the years, the underlying RTTI has been improved, so it can now do more than in the past, but is still cumbersome to use, see for instance [WayBack] tutorial script delphi Changing component class at run-time on demand – CODE Q&A Solved and [WayBack] TVirtualMethodInterceptor (Delphi) – RAD Studio Code Examples and [WayBack] Entropy Overload: Virtual method interception and [WayBack] Playing around with TVirtualMethodInterceptor | Delphi Haven with TVirtualMethodLogger.

Luckily there are more powerful alternatives based on the same ideas and/or underlying implementationIn fact, it can do so much for instance on the Spring4D and DSharp frameworks.

A demo is at [WayBack] Delphi sorcery: Pimp your unit tests using mock objects or [WayBack] Delphi sorcery: AOP and duck typing in Delphi.

The demo of the mocking framework was at code.google.com/archive/p/delphisorcery, but now is part of bitbucket.org/sglienke/dsharp at bitbucket.org/sglienke/dsharp/src/master/Source/Testing.

Some relevant directories:

Basically it is a playground for the more often updated and stable Spring4D where these directories and files are relevant:

–jeroen


Viewing all articles
Browse latest Browse all 1440

Trending Articles