Re: Why Cant we add a function to an existing Interface?



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.

Brian

"Babu" <Babu@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:5C9D431C-5317-4BA2-8F59-ADCB02E76AFC@xxxxxxxxxxxxxxxx
Isit possible to add a function to existing interface?
For example already i have published my component to a customer which
supports only one interface.
Now if i add some more functions to that interface and if i republish the
component, is it going to affect the customer?
If so whats the reason for that?


.



Relevant Pages

  • Re: Does Python really follow its philosophy of "Readability counts"?
    ... Separating an interface from its implementation reduces the ... whatever reason, it's unwilling to reveal to me. ... And `enforced data hiding' just slams ... Irrelevant for read-only inspection. ...
    (comp.lang.python)
  • RE: Who changed /proc/<pid>/ in 2.6.0-test5-bk9?
    ... kernel. ... A process has unity of interface. ... you cannot conjoin-clone and thread-clone repeatedly and variously from the ... If there is no reason to share, ...
    (Linux-Kernel)
  • Re: WinXP 64-bit Virtual DMA_ADAPTER
    ... Such interface abstracts from any internal implementation ... system that runs without Verifier. ... If MSFT wants a black box OS, ... reason why it should work differently under 64. ...
    (microsoft.public.development.device.drivers)
  • Re: The Case for Multiple-Inheritance
    ... It's like a Java interface ... functionality into modules; ... Clearly there is a reason you aren't running a consultancy. ... Classes defined by composing modules is bad practice. ...
    (comp.lang.ruby)
  • Re: Does Python really follow its philosophy of "Readability counts"?
    ... interface is what's documented as being the interface. ... We're told Python doesn't have private attributes. ... internals were inaccessible from Python code. ... always believe that their reason is a good reason. ...
    (comp.lang.python)