Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the "best practice" to remove support for a feature?

Tags:

java

I have a library that deals with several message formats. Each of these formats is closely related, they're a common base XML then each has some additional constraints or extra data on top of it.

One of these formats was created just to support a proof-of-concept or pilot effort. The pilot is over, its no longer being used, and it imposed some awkward constraints. I've gotten permission to remove support for it. What is the correct way to do this?

I'm thinking:

  1. Open an issue to track/document the changes
  2. Tag the SVN revision, "FEATURE_X removed here"
  3. @Deprecate the specific classes. Cite the issue. Commit.
  4. Watch the warnings and see what the deprecation affects
  5. Let it sit for a bit, give the team a chance to deal with the deprecation
  6. Finally remove the code. Verify that the tests are OK. Commit.
like image 527
Freiheit Avatar asked Dec 02 '10 18:12

Freiheit


2 Answers

I think you have a good list. To echo @hvgotcodes, this presupposes the API is not used by anyone outside your team. In either case, inside the deprecated method, I would log stacktraces for any calls to it. This would catch both internal and external uses.

like image 184
orangepips Avatar answered Oct 19 '22 23:10

orangepips


To the steps above, I'd suggest to clearly communicate to others that the feature will be dropped by the given deadline. And if the feature and/or team is big, I'll suggest get others commitment to remove their code dependencies by that date (the bigger team is, the more important the commitment is, consider managers support for this task). As my experience shows, removing something is a big surprise to a few users, and there is always someone somewhere with somecode that still depends on the FEATURE_X. And last but not least, additional step to do a dry-run removal, that can be easy and quickly undone.

like image 24
Przemek Kryger Avatar answered Oct 19 '22 23:10

Przemek Kryger