Interface in .NET -- mutable or not?

  • Thread starter Thread starter gz
  • Start date Start date
G

gz

Hi All,

It is my understanding that with .NET you can add or remove methods in
your interface while still maintain binary compatibility. This is not
true for COM. Does this mean that published interfaces under .NET are
no longer required to be immutable?

Best regards,
gz
 
Hi All,

It is my understanding that with .NET you can add or remove methods in
your interface while still maintain binary compatibility. This is not
true for COM. Does this mean that published interfaces under .NET are
no longer required to be immutable?

Best regards,
gz

Making any changes to an interface will break version compatibility.
Well, except in VB.NET you could add a nested type in an interface and
I don't think that would break anything, but I haven't tried it.
 
Well Visual Basic 2008 supports extension methods which provides "a way
to
extend existing types with new functionality without changing the
existing
contract"

Regards,
Jeff
 
Hi All,

It is my understanding that with .NET you can add or remove methods in
your interface while still maintain binary compatibility.
This is not true for COM.

The major differences between COM and .NET interfaces seem to be
1 .NET interfaces are not derived from IUnknown
2 .NET interfaces do not represent any sort of binary standard
Does this mean that published interfaces under .NET are
no longer required to be immutable?

Common sense alone says no. If an interface wasn't immutable what
purpose would the contract serve?

regards
A.G.
 
Jeff Louie said:
Well Visual Basic 2008 supports extension methods which provides "a way
to
That's also true for C# 3.0 (=C# Version in VS 2008)

Christof
 
You may appreciate this (by one of the world's leading authorities on .NET).

http://books.google.com/books?id=dS...msTh&sig=GEsjSwa5vWhuYHn6LwGtnv3IZcQ#PPA43,M1

I'm not certain what I am supposed to be looking at, binary
compatibility wasn't the question. According to MSDN unmanaged code
uses binary standards to ensure type compatibility while type
standards are used in managed code.

http://msdn2.microsoft.com/en-us/library/cwk974ks(vs.80).aspx
or
http://tinyurl.com/2d8mw4

regards
A.G.
 
Back
Top