views:

161

answers:

1

I have a custom SharePoint solution which requires several list instances on a particular site (SPWeb). Now some of these lists are generic, for example a 'Pages' document library, wheras others are highly specific custom lists.

My question is which (if any) apsects of customisations should be cleaned up on feature deactivation. My instincts would say that generic lists which may be used by multiple solutions should be left, but the more specific customisations should be cleaned up. Does anyone have any experience of and/or advice on this type of sceanrio?

+3  A: 

Its really hard to come up with a strict rule, as it will depend on your specific solution, however I would start with something like this:

On deactivation a feature should remove any artifacts created during feature activation that:

  1. Have not been created by an end user AND that end users could not reasonably expect would remain
  2. Is not required by any other feature, or that causes a failure in the broader solution it supports
  3. Does not prohibit the re-activation of the feature at some later time.

On the project I'm currently working on we created a new exception for preventing the deactivation of features. We found that in many cases the activation of features was a one way street. This was largely because a solution was typically made up of a number of features, and disabling one caused a break down in the entire solution.

Often, a site only existed in order to host the feature, disabling the feature then left no purpose for the site.

Daniel McPherson