<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-10106032.post8978022569059153657..comments</id><updated>2010-09-09T17:18:38.056+01:00</updated><category term='scripting'/><category term='DLR'/><category term='CLR'/><category term='xaml'/><category term='nexenta'/><category term='business'/><category term='visualized superstructure'/><category term='silverlight'/><category term='apple'/><category term='politics'/><category term='buy'/><category term='competition'/><category term='serialization'/><category term='printing'/><category term='RAII'/><category term='open source'/><category term='Tiburon'/><category term='bash'/><category term='CodeGen'/><category term='iterators'/><category term='acropolis'/><category term='C++'/><category term='dynamic typing'/><category term='Learning'/><category term='build'/><category term='ipod'/><category term='generics'/><category term='Delphi'/><category term='enumerators'/><category term='GC'/><category term='anonymous methods'/><category term='rich client'/><category term='solaris'/><category term='static typing'/><category term='itunes'/><category term='vista'/><category term='rant'/><category term='backup'/><category term='Erlang'/><title type='text'>Comments on Entropy Overload: Virtual method interception</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.barrkel.com/feeds/8978022569059153657/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10106032/8978022569059153657/comments/default'/><link rel='alternate' type='text/html' href='http://blog.barrkel.com/2010/09/virtual-method-interception.html'/><author><name>Barry Kelly</name><uri>http://www.blogger.com/profile/10559947643606684495</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp2.blogger.com/_2GNT8vlZj48/R3BcgmnurfI/AAAAAAAAAAY/Y9PdEUicKFg/S220/big-avatar-512.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>11</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-10106032.post-6219854650080591542</id><published>2010-09-09T17:18:38.056+01:00</published><updated>2010-09-09T17:18:38.056+01:00</updated><title type='text'>Really impressive! Is this a way to make APO (aspe...</title><content type='html'>Really impressive! Is this a way to make APO (aspect oriented programing) in Delphi?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10106032/8978022569059153657/comments/default/6219854650080591542'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10106032/8978022569059153657/comments/default/6219854650080591542'/><link rel='alternate' type='text/html' href='http://blog.barrkel.com/2010/09/virtual-method-interception.html?showComment=1284049118056#c6219854650080591542' title=''/><author><name>Vitor Luiz Rubio</name><uri>http://www.blogger.com/profile/09819146101627563485</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='02092560277644119077'/><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_tqOuULbALEo/SdYZiA1vnZI/AAAAAAAAACE/cFzxs5AZUJ0/S220/vitor.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.barrkel.com/2010/09/virtual-method-interception.html' ref='tag:blogger.com,1999:blog-10106032.post-8978022569059153657' source='http://www.blogger.com/feeds/10106032/posts/default/8978022569059153657' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-823533150'/></entry><entry><id>tag:blogger.com,1999:blog-10106032.post-2251860337049836798</id><published>2010-09-09T13:40:16.031+01:00</published><updated>2010-09-09T13:40:16.031+01:00</updated><title type='text'>It&amp;#39;s a very powerfull feature, and I&amp;#39;m hap...</title><content type='html'>It&amp;#39;s a very powerfull feature, and I&amp;#39;m happy to see it implemented in Delphi.&lt;br /&gt;&lt;br /&gt;BWT, for those who are using D2010, I&amp;#39;ve managed to implement something very similar to this to support mocking and other features on Emballo: http://code.google.com/p/emballo&lt;br /&gt;&lt;br /&gt;It&amp;#39;s a work in progress, but it&amp;#39;s already working.&lt;br /&gt;&lt;br /&gt;Unfortunately, being able to mock only virtual methods isn&amp;#39;t very helpfull. My goal is to make the interception possible for non virutal methods by using code overwriting, the same way people use to do dll hooking.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10106032/8978022569059153657/comments/default/2251860337049836798'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10106032/8978022569059153657/comments/default/2251860337049836798'/><link rel='alternate' type='text/html' href='http://blog.barrkel.com/2010/09/virtual-method-interception.html?showComment=1284036016031#c2251860337049836798' title=''/><author><name>Magno Machado Paulo</name><uri>http://blog.magnomachado.com.br</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.barrkel.com/2010/09/virtual-method-interception.html' ref='tag:blogger.com,1999:blog-10106032.post-8978022569059153657' source='http://www.blogger.com/feeds/10106032/posts/default/8978022569059153657' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-951965531'/></entry><entry><id>tag:blogger.com,1999:blog-10106032.post-28038893939653216</id><published>2010-09-07T16:46:50.742+01:00</published><updated>2010-09-07T16:46:50.742+01:00</updated><title type='text'>I got to look at something like spring.net, castle...</title><content type='html'>I got to look at something like spring.net, castle.net etc. Even more interesting thing is PostSharp.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10106032/8978022569059153657/comments/default/28038893939653216'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10106032/8978022569059153657/comments/default/28038893939653216'/><link rel='alternate' type='text/html' href='http://blog.barrkel.com/2010/09/virtual-method-interception.html?showComment=1283874410742#c28038893939653216' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.barrkel.com/2010/09/virtual-method-interception.html' ref='tag:blogger.com,1999:blog-10106032.post-8978022569059153657' source='http://www.blogger.com/feeds/10106032/posts/default/8978022569059153657' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-62253915'/></entry><entry><id>tag:blogger.com,1999:blog-10106032.post-4725765978188900189</id><published>2010-09-07T12:35:41.345+01:00</published><updated>2010-09-07T12:35:41.345+01:00</updated><title type='text'>Sure, it is easy to implement QueryInterface yours...</title><content type='html'>Sure, it is easy to implement QueryInterface yourself and thus decide which casts you allow. However, you also have to manufacture an interface pointer to return so the caller can invoke the interface&amp;#39;s methods. This involves dynamic generation of a vtable similar to what TVirtualMethodInterceptor does today.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10106032/8978022569059153657/comments/default/4725765978188900189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10106032/8978022569059153657/comments/default/4725765978188900189'/><link rel='alternate' type='text/html' href='http://blog.barrkel.com/2010/09/virtual-method-interception.html?showComment=1283859341345#c4725765978188900189' title=''/><author><name>Apollonius</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.barrkel.com/2010/09/virtual-method-interception.html' ref='tag:blogger.com,1999:blog-10106032.post-8978022569059153657' source='http://www.blogger.com/feeds/10106032/posts/default/8978022569059153657' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1162282553'/></entry><entry><id>tag:blogger.com,1999:blog-10106032.post-8718553572536728994</id><published>2010-09-06T21:22:48.352+01:00</published><updated>2010-09-06T21:22:48.352+01:00</updated><title type='text'>Apollonius - it&amp;#39;s true, .NET remoting is more ...</title><content type='html'>Apollonius - it&amp;#39;s true, .NET remoting is more powerful, and I agree, instrumenting every method call, including statics, and every field access, including field-backed properties (as Leonardo suggests) would be a step too far, because the compiler would have no way ahead of time knowing which classes would be modified at runtime, and would therefore make every access slower. So it is only for explicitly labeled virtual methods for now. I could envision however an &amp;quot;instrumentable&amp;quot; class, specifically labeled as such, whereupon every property access and every non-virtual method gains &amp;quot;virtual-like&amp;quot; behaviour, not in the language, but in the runtime, with sufficient indirection to approach the power of .NET&amp;#39;s remoting.&lt;br /&gt;&lt;br /&gt;As to dynamically implementing interfaces, technically, much of that is possible today, so long as QueryInterface is in the call chain when the dynamic cast occurs. That&amp;#39;s not always the case, of course.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10106032/8978022569059153657/comments/default/8718553572536728994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10106032/8978022569059153657/comments/default/8718553572536728994'/><link rel='alternate' type='text/html' href='http://blog.barrkel.com/2010/09/virtual-method-interception.html?showComment=1283804568352#c8718553572536728994' title=''/><author><name>Barry Kelly</name><uri>http://www.blogger.com/profile/10559947643606684495</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08331762029805209075'/><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp2.blogger.com/_2GNT8vlZj48/R3BcgmnurfI/AAAAAAAAAAY/Y9PdEUicKFg/S220/big-avatar-512.png'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.barrkel.com/2010/09/virtual-method-interception.html' ref='tag:blogger.com,1999:blog-10106032.post-8978022569059153657' source='http://www.blogger.com/feeds/10106032/posts/default/8978022569059153657' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-630653472'/></entry><entry><id>tag:blogger.com,1999:blog-10106032.post-1567657336896912643</id><published>2010-09-06T21:22:42.274+01:00</published><updated>2010-09-06T21:22:42.274+01:00</updated><title type='text'>Adding interface implementations should already be...</title><content type='html'>Adding interface implementations should already be possible by intercepting the virtual method QueryInterface.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10106032/8978022569059153657/comments/default/1567657336896912643'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10106032/8978022569059153657/comments/default/1567657336896912643'/><link rel='alternate' type='text/html' href='http://blog.barrkel.com/2010/09/virtual-method-interception.html?showComment=1283804562274#c1567657336896912643' title=''/><author><name>Uwe Raabe</name><uri>http://www.uweraabe.de</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.barrkel.com/2010/09/virtual-method-interception.html' ref='tag:blogger.com,1999:blog-10106032.post-8978022569059153657' source='http://www.blogger.com/feeds/10106032/posts/default/8978022569059153657' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-94949759'/></entry><entry><id>tag:blogger.com,1999:blog-10106032.post-811490702451338849</id><published>2010-09-06T21:17:09.966+01:00</published><updated>2010-09-06T21:17:09.966+01:00</updated><title type='text'>To Anonymous decrying the high-concept thing: I&amp;#3...</title><content type='html'>To Anonymous decrying the high-concept thing: I&amp;#39;d look at this feature as a piece of infrastructure, like I said, that third party libraries (that may be oriented towards testing or remoting etc.) may use. Its usefulness for the average developer may not be high, but the usefulness of the things you can build with it would, I believe, be much higher.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10106032/8978022569059153657/comments/default/811490702451338849'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10106032/8978022569059153657/comments/default/811490702451338849'/><link rel='alternate' type='text/html' href='http://blog.barrkel.com/2010/09/virtual-method-interception.html?showComment=1283804229966#c811490702451338849' title=''/><author><name>Barry Kelly</name><uri>http://www.blogger.com/profile/10559947643606684495</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08331762029805209075'/><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp2.blogger.com/_2GNT8vlZj48/R3BcgmnurfI/AAAAAAAAAAY/Y9PdEUicKFg/S220/big-avatar-512.png'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.barrkel.com/2010/09/virtual-method-interception.html' ref='tag:blogger.com,1999:blog-10106032.post-8978022569059153657' source='http://www.blogger.com/feeds/10106032/posts/default/8978022569059153657' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-630653472'/></entry><entry><id>tag:blogger.com,1999:blog-10106032.post-6221077566998554408</id><published>2010-09-06T20:49:30.538+01:00</published><updated>2010-09-06T20:49:30.538+01:00</updated><title type='text'>Definitely interesting. .NET Remoting is much more...</title><content type='html'>Definitely interesting. .NET Remoting is much more powerful - it allows interception of nonvirtual methods and even field accesses - but requires inheritance from MarshalByRefObject. Although this is nice to have, I would not advocate it for an unmanaged language like Delphi. It would require cooperation from the compiler and cause a runtime overhead even for accesses of non-proxy objects, so it is not worth the disadvantages in my opinion.&lt;br /&gt;&lt;br /&gt;The next step would be the possibility to implement additional interfaces which are not implemented by the original class. It would be even cooler if this could be done on demand like in .NET where you can implement IRemotingTypeInfo and thus decide if you implement an interface just when the cast occurs.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10106032/8978022569059153657/comments/default/6221077566998554408'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10106032/8978022569059153657/comments/default/6221077566998554408'/><link rel='alternate' type='text/html' href='http://blog.barrkel.com/2010/09/virtual-method-interception.html?showComment=1283802570538#c6221077566998554408' title=''/><author><name>Apollonius</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.barrkel.com/2010/09/virtual-method-interception.html' ref='tag:blogger.com,1999:blog-10106032.post-8978022569059153657' source='http://www.blogger.com/feeds/10106032/posts/default/8978022569059153657' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1162282553'/></entry><entry><id>tag:blogger.com,1999:blog-10106032.post-8517233320806835380</id><published>2010-09-06T20:44:39.735+01:00</published><updated>2010-09-06T20:44:39.735+01:00</updated><title type='text'>Lovely!</title><content type='html'>Lovely!</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10106032/8978022569059153657/comments/default/8517233320806835380'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10106032/8978022569059153657/comments/default/8517233320806835380'/><link rel='alternate' type='text/html' href='http://blog.barrkel.com/2010/09/virtual-method-interception.html?showComment=1283802279735#c8517233320806835380' title=''/><author><name>gabr</name><uri>http://www.blogger.com/profile/06903558857617342477</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.barrkel.com/2010/09/virtual-method-interception.html' ref='tag:blogger.com,1999:blog-10106032.post-8978022569059153657' source='http://www.blogger.com/feeds/10106032/posts/default/8978022569059153657' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1868762703'/></entry><entry><id>tag:blogger.com,1999:blog-10106032.post-4281586950783737793</id><published>2010-09-06T20:41:51.993+01:00</published><updated>2010-09-06T20:41:51.993+01:00</updated><title type='text'>Barry,

as always: you have very interesting conce...</title><content type='html'>Barry,&lt;br /&gt;&lt;br /&gt;as always: you have very interesting concepts and ideas. But, which &amp;quot;normal&amp;quot; coder can cope with such high sophisticated language constructs? I like the &amp;quot;keep it simple and stupid&amp;quot;. 2-5%???  It is not worth your effort.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10106032/8978022569059153657/comments/default/4281586950783737793'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10106032/8978022569059153657/comments/default/4281586950783737793'/><link rel='alternate' type='text/html' href='http://blog.barrkel.com/2010/09/virtual-method-interception.html?showComment=1283802111993#c4281586950783737793' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.barrkel.com/2010/09/virtual-method-interception.html' ref='tag:blogger.com,1999:blog-10106032.post-8978022569059153657' source='http://www.blogger.com/feeds/10106032/posts/default/8978022569059153657' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-457882119'/></entry><entry><id>tag:blogger.com,1999:blog-10106032.post-3992938725930396625</id><published>2010-09-06T19:54:36.696+01:00</published><updated>2010-09-06T19:54:36.696+01:00</updated><title type='text'>Very interesting Barry, as usual. It would be nice...</title><content type='html'>Very interesting Barry, as usual. It would be nice also to have Property interceptors in a future version, not just properties that have getters and/or setters, but properties of the type &amp;quot;property myProp: string read FProp write FProp&amp;quot; (that write directly to variables).&lt;br /&gt;&lt;br /&gt;Why this could be important to me?, imagine an RTTI based ORM, that assign just a couple of values to an object that has, say 10 properties, then call the method &amp;quot;save&amp;quot; to store the object in a databse. With &amp;quot;property interceptors&amp;quot; the programmer could know at runtime wich properties were changed, then automatically create an sql update command with just those properties.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10106032/8978022569059153657/comments/default/3992938725930396625'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10106032/8978022569059153657/comments/default/3992938725930396625'/><link rel='alternate' type='text/html' href='http://blog.barrkel.com/2010/09/virtual-method-interception.html?showComment=1283799276696#c3992938725930396625' title=''/><author><name>Leonardo M. Ramé</name><uri>http://www.blogger.com/profile/01545328313711727680</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://4.bp.blogspot.com/_jiP-KkurPP8/SZby1WACBeI/AAAAAAAAAD0/r_ZsFd6rH5o/S220/yo.JPG'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.barrkel.com/2010/09/virtual-method-interception.html' ref='tag:blogger.com,1999:blog-10106032.post-8978022569059153657' source='http://www.blogger.com/feeds/10106032/posts/default/8978022569059153657' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-653007156'/></entry></feed>
