On 21.03.2013 21:15, Hans-Peter Diettrich wrote:
Sven Barth schrieb:

 > 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.

Use an object (class instance) for the same purpose, and you don't have
to write additional code as well.

Interfaces are there to abstract away the implementation, because you'll only have access to those methods that the interface defines. This allows for low coupling between components and thus for an improvement of code testability and maintainability.

Regards,
Sven


--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to