Sunday, May 28, 2006

David Glassborow on extended RTTI

It turns out the story (part one, two and three) about getting RTTI for published method parameters isn’t over yet :-).

In Delphi 7, Borland extended the RTTI capabilities in order to support SOAP and WebSnap by introducing the (then undocumented) $METHODINFO compiler directive. We’ll look at this in more detail later, but in the mean time make sure you go to David Glassborow’s blog to read his great posts on Interface RTTI and Class RTTI!

He has even written a DetailedRTTI unit that can return a string representation of a method’s signature – without any event property hacks (but only for classes compiled with $METHODINFO ON). Note that his unit has some interesting record helpers and class helpers (so you need Delphi 2006 to compile it) – read about David’s view on class helpers as a design tool here.

Updated (27. Oct 2007): $METHODINFO was first available in Delphi 7, not Delphi 6.

1 comment:

Anonymous said...

Very cool. Have to back port it. Since classhelpers just have implicity "self" pointer to the object reference, it should not be too hard.


Copyright © 2004-2007 by Hallvard Vassbotn