Altering interface

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Thomas Schoch

    #1

    Altering interface

    I have written an interface IAddin for addins for my application. Now
    I have to add a new property to this addin.
    What is the best way to do this? I don't want to rewrite or recompile
    the existing addins because they are already installded on some client
    machines.

    My idea: Create a new interface IAddin2 which inherits from IAddin and
    add the new property. In the host application I can test wheter an
    addin support interface IAddin or IAddin2 and if it support IAddin2
    set the new property.
    Is this the way to go?

    tosch

  • Phill W.

    #2
    Re: Altering interface

    Thomas Schoch wrote:
    I have written an interface IAddin for addins for my application. Now
    I have to add a new property to this addin.
    What is the best way to do this?
    My idea: Create a new interface IAddin2 which inherits from IAddin and
    add the new property.
    So long as you're only adding new stuff, this sounds like the way to go.

    As soon as you start wanting to remove stuff - panic! :-)

    HTH,
    Phill W.

    Comment

    • Tom Shelton

      #3
      Re: Altering interface

      On 2007-02-22, Thomas Schoch <tosch@swiss-soft.chwrote:
      I have written an interface IAddin for addins for my application. Now
      I have to add a new property to this addin.
      What is the best way to do this? I don't want to rewrite or recompile
      the existing addins because they are already installded on some client
      machines.
      >
      My idea: Create a new interface IAddin2 which inherits from IAddin and
      add the new property. In the host application I can test wheter an
      addin support interface IAddin or IAddin2 and if it support IAddin2
      set the new property.
      Is this the way to go?
      >
      tosch
      >
      What you suggest is the common solution (and the suggested naming). If you
      need to remove stuff, then you need to create a whole new interface.

      --
      Tom Shelton

      Comment

      Working...