We collectively spend a great deal of time thinking about SharePoint solutions — how to create them, which tool to use, what happens when they fail to deploy, timer jobs, scopes, etc. We spend so much time thinking about the up-front bits that it’s easy to forget that we need to retract them as well. Retracting solutions is probably more difficult, from a conceptual design perspective, than deploying them. Deployment is basically a cookbook affair. Typically, install a feature, maybe have a feature receiver load some data into a list, that sort of thing. However, retracting is potentially more complex.
A given solution may create artifacts like these:
- Content Type
- List Definition
- Site Definition
- Data in a list
- Even receivers
- InfoPath forms
The list goes on.
While it’s obviously important to design a solution that instantiates those artifacts correctly, it’s just as important to consider the update and delete cases. If your solution creates a new list and populates that list with data, what happens when the solution is retracted? In some cases, the list should be deleted. In other cases, it should be left intact for historical purposes. Your business requirements will guide you to the right decision.
To help with this, create a matrix that lists each artifact your solution deploys to SharePoint. List three columns per artifact, one for create, update and delete. For each case, determine the correct outcome for that operation.
This sort of analysis is obviously best done before the solution is ever deployed to a SharePoint farm. However, like smoking, it’s never too late to start doing things correctly. Create that matrix and develop a plan to address the missing update/delete scenarios. It may be a hard problem to solve, but at least you’ll have put a box around the problem.
</end>
Follow me on Twitter at http://www.twitter.com/pagalvin
@no name
That’s what the Feature Receiver class is for. You write custom code to handle what ever you want within the Object Model in override methods within your custom Feature Reciever. See the MSDN article here.
Hope that helps 🙂
@Paul
I’m linking this article in this months SharePoint user group presentation because, as was discussed at this months SPUG, this is really a central issue to creating robust SharePoint features.
-john bender
nickelcode.com (blog)