Am 19.08.2017 09:12 schrieb "Ondrej Pokorny" <laza...@kluug.net>:
>
> Hello!
>
> Has anybody thought about multiple inheritance in object pascal? I am now
working on a client-server service that entirely uses ORM. I have several
patterns that repeat all over and some of them do not match into the direct
inheritance schema.
[snip]
> Any thoughs on it? Is it sensible? How do you solve multiple inheritance?

The designers of Object Pascal decided on purpose against multiple
inheritance as they probably saw the problems that C++ has with them. Even
Java and C#, both clearly influenced by C++ don't support multiple
inheritance.
Just think about one class in the inheritance graph reintroducing a virtual
method with different parameters. What will the final class do then?

Object Pascal already has capabilities in place to deal with the
shortcomings of single inheritance, namely interfaces (multiple of which a
class may implement) and delegation ("implements" keyword). That might
result in more code to write, but the result is cleaner and clearer.

Regards,
Sven
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to