Re: Why Cant we add a function to an existing Interface?
- From: "MikeD" <nobody@xxxxxxxxxxx>
- Date: Thu, 28 Dec 2006 13:06:26 -0500
"Brian Muth" <bmuth@xxxxxxxx> wrote in message news:OTZWsUqKHHA.1248@xxxxxxxxxxxxxxxxxxxxxxx
By adding a function you are breaking binary compatibility. Basically you are changing the definition of the interface and interfaces are supposed to be immutable.
The reason this is important is that there may be a client that codes using your interface definition and calls the new function. However he is using the original component which doesn't have this function. Obviously his code is going to crash even though he has done nothing wrong; he has an expectation that the interface has been fully defined and implemented.
That's not entirely correct. VB will let you ADD properties and methods to the public interface without forcing you to break binary compatibility. You cannot modify or delete existing members of the public interface, however. Other languages might not be this lenient.
--
Mike
Microsoft MVP Visual Basic
.
- Follow-Ups:
- Re: Why Cant we add a function to an existing Interface?
- From: Brian Muth
- Re: Why Cant we add a function to an existing Interface?
- References:
- Re: Why Cant we add a function to an existing Interface?
- From: Brian Muth
- Re: Why Cant we add a function to an existing Interface?
- Prev by Date: Re: Why Cant we add a function to an existing Interface?
- Next by Date: Re: Why Cant we add a function to an existing Interface?
- Previous by thread: Re: Why Cant we add a function to an existing Interface?
- Next by thread: Re: Why Cant we add a function to an existing Interface?
- Index(es):
Relevant Pages
|
Loading