Interfaces...am i missing the point?



OK i have been reading about interfaces

I have learned that when i include an interface as part of an object...

TMyObject = class(Tobject, IMyInterface)

I then have to implement all the functions/procedures defined in the
interface, inside my object??

So why have to interface in the first place, why not just create all the
function as methods of the object as i'll have to do that anyways.

Surely, i should define the interface and the methods that go with that
interface, then when i ant to use the interface, say in multiple components,
i don;t have to start over writing all the method code again..


What happens with Interfaces and COM? If I define the interface, how do i
define the methods, when i want the interface to call code in a com server?



I'm having trouble getting my head around this!

Reagrds

Vertuas


.



Relevant Pages

  • Re: Why not multiple inheritance in C# and java
    ... "mirror" of the innards of the business objects. ... Windows control type, and that offends me. ... > You can mimic MI by delegating your interface to a class implementing the ... > IMyInterface GetMyInterface() ...
    (microsoft.public.dotnet.languages.csharp)
  • I have a COM object installed on my machine...
    ... I wanted to pass an interface pointer to a ... they let me look at their COM object's IDL file and in that IDL file is ... only defined one interface and they tell me ... also inherits IMyInterface (which is not mentioned in the IDL for the COM ...
    (microsoft.public.vc.atl)
  • DLL2 should implement interface defined in DLL1 - how?
    ... implements that interface, too. ... interface IMyInterface; ... class ATL_NO_VTABLE CMyOtherInterface: ... and the stub compiler - rightfully - ...
    (microsoft.public.vc.atl)
  • Re: I have a COM object installed on my machine...
    ... > I wanted to pass an interface pointer to a ... they let me look at their COM object's IDL file and in that IDL file ... > only defined one interface and they tell ... > also inherits IMyInterface (which is not mentioned in the IDL for the COM ...
    (microsoft.public.vc.atl)
  • Interface delegates and implements
    ... I am trying to extend a set of GUI components with a set of common data ... define an interface with new properties in it, ... TMyDelegate = class(TComponent, IMyInterface) ...
    (borland.public.delphi.language.objectpascal)