<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Ryan Joseph via fpc-pascal <fpc-pascal@lists.freepasca023815.html ieb am Mo., 23. Dez. 2019, 06:01:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
> On Dec 22, 2019, at 5:26 AM, Sven Barth via fpc-pascal <<a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank" rel="noreferrer">fpc-pascal@lists.freepascal.org</a>> wrote:<br>
> <br>
> You don't seem to understand what implementing an interface means in Object Pascal. It means that a class can be cast to an interface. It does *not* mean that the interface's methods are available from that class.<br>
<br>
I guess I'm not seeing the design pattern which they was invented for and I've never come across it in my own work. Not against the idea in any way however.<br>
<br>
My mind went in the same direction as Adriaan's did when I saw "implements" I thought that one class could be built from many smaller classes but share the same namespace (like in multiple inheritance or entity/component designs). If a class implements an interface via a delegate then I would expect this to function the same as inheritance, i.e. the namespaces are merged and share functions. Doesn't that make sense?<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">It does make sense, but not in the context of interfaces. They are not there to provide implementations, but to provide a known API to the user. </div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Maybe what I mean to say is that there's a need for a delegation syntax that functions like multiple inheritance and avoids the traps of deeply nested single inheritance hierarchies. Does anyone else agree? <br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">What might be more interesting in this context than multiple inheritance is the concept of aspects (aka aspect oriented programming though you might also want to look for "mixin"; there's an old thread about that: <a href="https://lists.freepascal.org/fpc-pascal/2009-December/023815.html">https://lists.freepascal.org/fpc-pascal/2009-December/023815.html</a>). If we could find an agreeable syntax and implementation for that then we'd be potentially inclined to include that as a new feature as there had been experiments for that in the past. </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>