Coffeehouse Post

Single Post Permalink

View Thread: .Net versioning question
  • User profile image

    , BitFlipper wrote

    @cbae: That works in theory but in practice is not possible due to there being 7500 methods as stated earlier. There is no way I can manually code that up. Also each call is quite a bit more involved than your example, with many external variables needed, so even just one wrapped method would be quite complex with many required arguments. At that point I might as well just stick with the original solution as it will actually be a bit less code overall (yet still way too much code duplication to be maintainable).

    I also said:

    That is if you don't want to simply change each of the Api classes to implement a common interface to begin with.

    If you don't want the extra wrapper you can make each of the Api classes implement the same interface.

    You don't have to do anything to the methods of the concrete classes. You need only change the class declaration, and all the existing methods that have the same signature as defined in the interface will automatically implement the interface.

    However, you will need to create the interface with all of the 7500 method signatures. That's the bullet you'll have to bite, but creating the interface would be just like creating a new Api class without having any code.