Implementing Interfaces in C#

From: Frank J. Reashore (reashore_at_NOSPAMTelus.net)
Date: 02/16/04


Date: Sun, 15 Feb 2004 16:25:26 -0800

Hello Everyone,

I am implementing a simple interface in C# using Visual Studio .net and was
quite surprised to discover that the C# compiler does NOT complain if a
method on the interface is not implemented.

VB.net on the other hand generates a compile error if a method is not
implemented. This helps in ensuring that all interface methods are
implemented.

The fact that C# does not provide such compile errors makes implementing and
interface in C# more labor intensive than in VB.net. You have to use the
object browser and check the function signature, etc.

Is this normal behavior? Could I possibly be doing something wrong?

Any help would be appreciated.

Regards,
Frank J. Reashore

Vancouver, Canada



Relevant Pages

  • Re: creaping coupling......
    ... but it is a more strict contract than required. ... "I am capable of implementing things via interface XYZ i.e. ... consider specifically that we compile, deploy and then we delete a method to ... IWriteable pipe = new Pipe; ...
    (comp.object)
  • Re: ActiveX.exe question
    ... > the public interface still need registered in order to use them. ... Compile AXExe.exe against a Share on the TestPC ... Open a Standard-Exe-Project on your DevelopPC and name it AXTest ... Compile AXTest.exe against the Share on the TestPC ...
    (microsoft.public.vb.general.discussion)
  • Re: RAD vs. performance
    ... thus they fulfull the number interface and can be used interchangeably. ... I'm not about to ditch statically typed languages ... Because you need whole-program optimisation for a start. ... The benefits of static typing come at compile time. ...
    (comp.lang.misc)
  • Re: Is Direct3D a rip-off of OpenGL?
    ... People who think that a method change in a NEW INTERFACE in DirectX really ... Moving to use a NEW INTERFACE, ... > ago simply isn't going to compile with the latest SDK, ...
    (comp.graphics.api.opengl)
  • Re: Variable uses a type not supported in Visual Basic (Error 458)
    ... > Microsoft Visual Basic for Applications Software Development Kit ... > interface in a Visual Basic class, ... > generate libraries that use a Visual Basic- or Visual Basic for ... > Rebuild your type library by pressing CTRL+F7 or selecting Compile ...
    (microsoft.public.vb.bugs)