[fpc-pascal] Extend multiple classes with same code

Zaher Dirkey parmaja at gmail.com
Sat May 19 16:28:55 CEST 2012

On Sat, May 19, 2012 at 2:10 AM, Jorge Aldo G. de F. Junior <
jagfj80 at gmail.com> wrote:

> You simply cant do it. Not even multiple inheritance would help you in
> this case.
> You will have to extend each class by hand.
> Multiple inheritance would allow you to join back branches in the
> class hierarchy, but in this case you want to add the same
> functionality to multiple branches, but keep the branches separate
> entities. This is impossible with current freepascal OOP and i dont
> think this is even a good thing to have.
I have no Idea about "multiple inheritance".

I am thinking now if i can assign a helper to more than one class by make
base helper, then inherit it for every class B1 and B2.
I will try and post a feedback.

> It could be done multi-class helper, kind of class helper that works
> on multiple classes. But i dont even know of a language that has such
> possibility (i dont know much languages anyway).

I hope i can find one, not for me for my kids in the future ;)

Best Regards
Zaher Dirkey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20120519/6e53ddb6/attachment.html>

More information about the fpc-pascal mailing list