1

I have an old method that is rarely being used by a third part clients that i want to change it's signatures(mostly renaming).

How should I do that? what are the risks? Are there any real advantages?

A simple example:

Class Program
{
    public void OldMethodName(var oldVarName)
    {
        //Do something
    }
}

Change to

Class Program    
{
    public void NewMethodName(var newVarName)
    {
        //Do the same thing
    }
}
Dolev
  • 654
  • 11
  • 20

1 Answers1

3

When your API is in public use, you should refactor it in two stages:

  • Release a version with both APIs available - this version of the API should make new methods available, and deprecate old methods. This will give your clients time to migrate.
  • After a period of waiting, release a version with deprecated methods removed - when possible, coordinate this release with your clients to ensure that they have migrated to using new methods.

See this Q&A for information on how to deprecate methods.

There are no advantages to changing signatures of public methods, other than fixing current or potential naming collisions.

Community
  • 1
  • 1
Sergey Kalinichenko
  • 714,442
  • 84
  • 1,110
  • 1,523