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:
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:
Click here to read the same content in Portuguese.