The Features framework is something completely new in both MOSS 2007 and WSS 3.0. This framework enables you to package SharePoint functionality (be it a SharePoint list definition, a site definition, some web parts, UI components, or a combination of the previously mentionned ...) and to deploy it in a flexible way on a SharePoint server. It provides a more granular approach for adding functionality since you don't need to wrap your new functionality anymore in a site definition. For a detailed description take a look at Working with Features
What is interesting to now is that the SharePoint team has actually used this feature framework itself to built WSS 3.0 and MOSS. E.g. all the standard built-in list types are created as separate features. You will find them underneath c:\program files\common files\microsoft shared\web server extensions\12\templates\features\ - for an overview of which of these features are linked to MOSS and which to WSS - take a look at What's a MOSS vs WSS feature.
So if you navigate to C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\AnnouncementsList you will see the feature.xml for the announcements list.
<?xml version="1.0" encoding="utf-8"?>
If you look at it from a developers stand point a feature is actually nothing more then a couple of XML files and their associated resources. Which are the most interesting "features of features":
- Possible to extend existing sites "Light up"
- Activation and deactivation of features
Every features is scoped at a certain level:
- Web application
- Site Collection
So if you need to deploy a certain component for a specific type of site (so actually a specific site defintion) you can actually use a feature for it - for a complete discussion of how to do this take a look at the post about Feature stapling
So what do you need when you create a new Feature - a very simple feature will just require to simple files:
- MyFeatureName.xml : defines the feature itself and the different components linked to this feature
- Elements.xml : definition of the separate components - the feature.xml actually references Elements.xml
It is also possible to hook up your own event handlers with activation and deactivation event of features. Take a look at Feature Events - these feature provisioning callouts allow you to write code that handle specific events that occur in the lifecycle of a Feature.
The easiest way to learn more about features is to take a look at the OOTB features available as well as to the resources listed below.
Some interesting uses of features: