When site definitions are necessary ?

Jan 25, 2009 at 11:43 PM
For me, features, features stapling and solutions do the job, why should I use site definitions ?

Jan 26, 2009 at 7:24 PM
If you look at the supplied documentation they address this in the Designing of the Training Management Application / Architectural Decisions / Using Site Definitions page of the CHM file.

Personally, I would in most cases not use a site definition unless the application could be installed more than once, like say a project team site. Otherwise I would rely on feature activation after site provisioning but I could see enterprise scenarios where the business would require as simple an installation process as possible. Feature stapling to me is limited with OOB templates because features are activated every single time the template is used to create a site. I can't readily see to many scenarios aside from look and feel where this would be useful.
Feb 6, 2009 at 6:17 PM

Here is our recommendation about Site Def:

1)      You should think site def as a thin layer representing a collection of features to apply for a specialized site.  Site def is a convenient mechanism to create a specialized site containing a number of different features rather than creating a blank site and applying many features manually.  The functionality should be contained in feature definitions.

2)      Site definitions make site provisioning much easier if you have many features that need to be activated. Granted this functionality can be replaced with a bat file or a feature receiver that will activate other features.

3)      In fact, our Contoso training management reference implementation site def doesn’t really contain anything; all of the functionality is captured in features.

Here is our recommendation about feature stapling:

1)      Features staple to a site def.  You can’t use feature stapling if you don’t have a site definition to staple it to.

2)      Once you have a site def, you can staple a feature with any kind of functionality you desire, from look and feel to additional web parts, workflows…

3)      We recommend  that you only staple features to your own custom site def.

4)      You should be very careful if you do decide to staple features to an out-of-the-box site def such as team or blank.  The features you staple should only be general and broadly applicable ones. The reason is that once you staple a feature to an out of box site def, you can no longer use the site def without applying the feature you stapled to it. That may not be what you want.