[Lazarus] IUnknown and reference counting

Sven Barth pascaldragon at googlemail.com
Thu Mar 21 20:44:58 CET 2013


Am 21.03.2013 18:58 schrieb "Hans-Peter Diettrich" <DrDiettrich1 at aol.com>:
>
> Sven Barth schrieb:
>
>> Am 21.03.2013 14:42, schrieb Michael Schnell:
>>>>
>>>> * the ability to delegate the implementation of the interface to a
different class (using the "implements" keyword)
>>>
>>> To allow for a kind of multiple inheritance, I supple.
>>
>> It kind be used for a kind of multiple inheritance, but it's main
purpose is to avoid code duplication.
>>
>> For more information you can take a look here:
http://www.freepascal.org/docs-html/ref/refse39.html#x91-1010007.4
>
>
> Interface delegation is something different from multiple inheritance.
The interface implementor and the interfaced object then have nothing in
common, the methods of the implementor cannot access elements of the
interfaced object.

But with only interfaces you inherit merely the syntactical "interface"
while with delegation you can also reuse an existing implementation for
that interface.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20130321/e8ce55c2/attachment-0003.html>


More information about the Lazarus mailing list