SharePoint list definition using the Template pattern

added by rholm
1/14/2010 1:52:45 PM

1 Kicks, 64 Views

Books on SharePoint often show how to create lists from code by calling the SharePoint API from directly within a feature receiver. This event handler contains column names as in-place string literals, it updates the default view, and so on. While such an approach provides a nice demonstration of the SharePoint API, it also tends to carry over into production code. My take on feature receivers, however, is that they should contain the least possible amount of code. Staying true to object-orientation and the separation of concerns, list definition and creation should be abstracted into a common set of classes and methods.