<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: Arial; font-size: 10pt; color: #000000'><br>----- "Jonas Maebe" <jonas.maebe@elis.ugent.be> schreef:
<br>> <br>> <div><div>On 21 Dec 2010, at 00:16, Jonas Maebe wrote:</div><br class="Apple-interchange-newline"><blockquote><div>On 20 Dec 2010, at 21:37, Sven Barth wrote:<br>> <br>> <blockquote>- should abstract methods be forbidden?</blockquote><br>> Yes, since<br>> a) they are virtual<br>> b) even if it were possible to have virtual methods, there would be no way to override them with implementations that do something (since you cannot inherit from a class helper)<font class="Apple-style-span" color="#000000"><font class="Apple-style-span" color="#144fae"><br>> </font></font></div></blockquote><br>> </div><div>Actually, it seems that inheritance is in fact allowed for Delphi-style class helpers: <a href="http://qc.embarcadero.com/wc/qcmain.aspx?d=76577" target="_blank">http://qc.embarcadero.com/wc/qcmain.aspx?d=76577</a> (it's not for Objective-C categories). But I'm still quite sure you cannot do anything that requires changes to the VMT of the helped class.</div><div><br>> </div><div>There are also at some extra checks that must be added for constructors/destructors introduced via class helpers (Objective-C/Pascal doesn't have constructors or destructors, so it doesn't matter there):</div><div>* <a href="http://docwiki.embarcadero.com/RADStudio/en/E2295_A_class_helper_cannot_introduce_a_destructor_%28Delphi%29" target="_blank">http://docwiki.embarcadero.com/RADStudio/en/E2295_A_class_helper_cannot_introduce_a_destructor_(Delphi)</a></div><div>* <a href="http://docwiki.embarcadero.com/RADStudio/en/E2296_A_constructor_introduced_in_a_class_helper_must_call_the_parameterless_constructor_of_the_helped_class_as_the_first_statement_%28Delphi%29" target="_blank">http://docwiki.embarcadero.com/RADStudio/en/E2296_A_constructor_introduced_in_a_class_helper_must_call_the_parameterless_constructor_of_the_helped_class_as_the_first_statement_(Delphi)</a></div><div>* <a href="http://docwiki.embarcadero.com/RADStudio/en/E2358_Class_constructors_not_allowed_in_class_helpers_%28Delphi%29" target="_blank">http://docwiki.embarcadero.com/RADStudio/en/E2358_Class_constructors_not_allowed_in_class_helpers_(Delphi)</a></div><div><br>> </div><div><br></div>hi,<br><br>it seems that the virtual methods can be overridden (AOP style) using the TVirtualMethodInterceptor that comes with Delphi XE. It can also be on a per instance base (as opposed to on a per type) if I've read up on it correctly.<br><br>I'd say that would be a better candidate for that purpose/intent/use case.<br><br>kind regards,<br>Dimitri Smits<br><br><br></div></body></html>