But your inheritance is a framework - you add your own features, and modify some of those inherited. You may be able draw when your parents cannot, but you are not such a good cook maybe. Inheritance in Object oriented languages like Delphi has much the same features, as you will see. Inheritance in Delphi.
I am trying to do the GoF adapter pattern and in the C# example that I am following the Adapter class is inheriting the original class and an adapting interface.In Delphi (2007), as far as I know, this is not possible, or is it? Cause if a class is inheriting an interface, it needs to inherit from TInterfacedObject and since Delphi doesn't allow multiple class inheritance, that is the end of story. I cannot inherit from a custom class and an interface at the same time.
Am I correct?
Thank you.
I have implemented this pattern on http://delphipatterns.blog.com/2011/02/22/decorator-5/
electorelector
1 Answer
No that it not correct. You can add an interface to any class you like as follows:
David HeffernanDavid Heffernan
Not the answer you're looking for? Browse other questions tagged delphiinheritanceinterfacedelphi-2007 or ask your own question.