It may have been hope that also inspired the boat anchor I found in the code in my org. In technical circles, some people only think of boat anchors as that outside technology they got stuck with because their boss bought it without conducting a technical review. But if you aren't constantly conducting a technical review of your own code, you can get stuck with boat anchors there as well.
In my org, I found something like the following:
All code that had once handled business logic was commented out to the point where the code literally did nothing but returned a null value. I think this boat anchor represented the developer's hope that the original code might somehow be useful later. If that's the hope, the code can be stored outside of our production org.
To remove it, we just needed to correct any references and delete the class and its related unit test. Salesforce offers multiple ways to accomplish this using the IDE, the developer Workbench or the Migration Tool, all of which are much less painful than Auntie Pat Tern's tattoo removal.
With Workbench, for example, you can simply mark a class or trigger as deleted or as inactive to remove it from production using the following steps after downloading the class or trigger files:
- Edit the XML meta file for the class or trigger to change its status from <status>Active</status> to <status>Deleted</status> (for classes) or <status>Inactive</status> (for triggers)
- Put the both the .XML file and class or trigger file into a folder named "classes".
- Create a package.xml file to list the class or trigger to be deleted or made inactive.
- Place both the package.xml file and the classes folder into another folder inside a zip file.
- Specify this zip file after you select Migration>Deploy in Workbench.
Like Auntie Pat Tern, be on the lookout for boat anchors and consider removing them when they pop up during your org's ongoing technical review.
Here is a step-by-step on creating a package.xml file with Workbench: https://drive.google.com/open?id=0B9HduBZJMbH2S3FjTVFhd3RNZzA
ReplyDelete