Sandeep asks:

> If I have to redeclare all the methods in interface in the descended
> class then why not get rid of interface and I still have the same
> thing. What's wrong with that?

Nothing, but if you want to have two seperate object hiearchies sharing the
same interface you only have two choices. Either create shared base class
and use this in both hierarchies, or use an interface implemenedt at the
appropiate place in each hierarchy. It all depends on what you have
available to work with, and how much you like managing deep hierarchies.

Interfaces mean that you have can manipulate an object that provides the
interface without needing to know the objects class at runtime. Otherwise
you need to have lots of code that does tests and casts, or have a shared
base class to achieve the same thing.

Cheers, Max.


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to