SharePoint 4 Developers

Additional reference guide in .NET / SharePoint Development

Site Definitions – A legacy

Site Definition and its legacy. Experiences with the MOSS 2007 Upgrade to SharePoint 2010.

Hi folks,

In this post I want to talk a little about Site Definitions and the legacy you get when using them.

Site Definitions are present in all SharePoint installations, considering the last recent versions:

  • WSS 3.0 and MOSS 2007 – available at the directory %\12\TEMPLATE\SiteTemplates

  • SharePoint Foundation and Server 2010 - available at the directory %\14\TEMPLATE\SiteTemplates

So using these templates for customisation and extension is really normal, right?

That's not quite right…its utilisation at first seems to be the best solution, because it allows us to create definitions of the objects that will compose the Web Site. Besides we can make it available in Tabs at the moment of creating a Web Site, which makes easy for users to select the correct Template.

The main issue is the legacy that this solution gives you. Currently I am working with the Upgrade of SharePoint 2010 Solutions developed for MOSS 2007 and have seen how complex is to upgrade Heavy Site Definitions. First you laugh, then you cry! :)

As a developer I always chase a way to create reusable code, and the utilisation of Site Definitions allows us that.  You must know that is more productive the development based on something that already exists rather than creating something from the scratch.

Nevertheless it is important to understand this legacy and its futures consequences. This concern applies to all solutions in any technology! I agree that in most of the cases the SharePoint development comes from experience, because in many cases documentation is scarce.

Best practices are important, in this specific case I give you some tips:

  • Use Light Site Definitions, that contain few objects (just the essential ones).

  • After creating a Site Definition, use Feature Stapling to add other objects.

  • If your solution works without using a Custom Site Definition, probably you don’t need it.

Unlike those that come to abolish such use [nothing against the IT guys :)], I am for it because I have the following thinking: if the technology allows us to use this resource, so it means we can use it. Just be responsible and pay attention to its purpose and the right utilisation.

Be welcome to comment if you wish!

Please find below some links related to this post:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;898631
http://msdn.microsoft.com/en-us/library/aa978512.aspx
http://msdn.microsoft.com/en-us/library/aa979683.aspx
http://msdn.microsoft.com/en-us/library/ms454677.aspx
http://spg.codeplex.com

Cheers,

Marcel Medina

Click here to read the same content in Portuguese.