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
Peter Bromberg [C# MVP] - 11 Oct 2007 20:45 GMT
If you add a method to an interface, any class that derives from it will
break because it does not fully implement your interface. Does that help?
-- Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com
> Hi All,
>
[quoted text clipped - 5 lines]
> Best regards,
> gz
gz - 11 Oct 2007 21:26 GMT
On Oct 11, 2:45 pm, Peter Bromberg [C# MVP]
<pbromb...@yahoo.yohohhoandabottleofrum.com> wrote:
> If you add a method to an interface, any class that derives from it will
> break because it does not fully implement your interface. Does that help?
[quoted text clipped - 15 lines]
>
> - Show quoted text -
Hi Peter,
I can see that. But am I supposed to change the interface even in the
cases when I can?
Thanks,
gz
Brian Gideon - 11 Oct 2007 20:54 GMT
> Hi All,
>
[quoted text clipped - 5 lines]
> 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.
Jeff Louie - 11 Oct 2007 23:19 GMT
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
Christof Nordiek - 12 Oct 2007 15:23 GMT
> 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
Registered User - 12 Oct 2007 13:07 GMT
>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.
Larry Smith - 12 Oct 2007 13:32 GMT
> 2 .NET interfaces do not represent any sort of binary standard
You may appreciate this (by one of the world's leading authorities on .NET).
http://books.google.com/books?id=dSiuGk0RZ4gC&pg=PA43&lpg=PA43&dq=juval+lowy+net
+%22every+class+is+a+binary+component%22&source=web&ots=wxe6jvmsTh&sig=GEsjSwa5v
WhuYHn6LwGtnv3IZcQ#PPA43,M1
Registered User - 12 Oct 2007 17:58 GMT
>> 2 .NET interfaces do not represent any sort of binary standard
>
>You may appreciate this (by one of the world's leading authorities on .NET).
>
>http://books.google.com/books?id=dSiuGk0RZ4gC&pg=PA43&lpg=PA43&dq=juval+lowy+net
+%22every+class+is+a+binary+component%22&source=web&ots=wxe6jvmsTh&sig=GEsjSwa5v
WhuYHn6LwGtnv3IZcQ#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.