[fpc-devel] Multiple inheritance
pascaldragon at googlemail.com
Sat Aug 19 09:27:30 CEST 2017
Am 19.08.2017 09:12 schrieb "Ondrej Pokorny" <lazarus at kluug.net>:
> 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
> 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
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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-devel