On 07/10/16 12:29, stdreamer wrote:
No! Delegation is a mechanism, when used, you have to know exactly how it works. Delegation is only used to minimize code instead of writing a bunch of procedures that call the contained object's methods. That's it and nothing more.

I believe that I now understand the issues around interface delegation and how to use it. You are correct, it's only an optimisation - and it sucks. I would never recommend anyone to use interface delegation as you have to only put a "foot wrong" and can end up memory leaks on one side, or access violations on the other. Writing a "bunch of procedures" may be tedious but it's less work in the end.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to