List Definitions versus List Templates and deciding on the correct customization approach

List Definitions

A list template Feature includes a Schema.xml file that serves as the base file for a list definition. The List element is the root element of a Schema.xml file, which contains default view definitions, definitions for special fields used in the list, the toolbar definition for list views, content type declarations, and other metadata for the list.


A list definition includes a Feature.xml Files file, an element manifest file (see List Template Files), and a Schema.xml file within a Feature folder (\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES). For an example that shows how to create a custom list definition, see how to: Create a Custom List Definition:

Lists can be created or modified programmatically through the object model (for example, members of the SPList and SPListCollection classes), through the Lists Web service (methods of the Lists class), and through Remote Procedure Call (RPC) protocol (see Microsoft Windows SharePoint Services RPC Methods).

Introduction to Lists:

List Schema:

Major Schema Definition Files:


List Templates

A list template is something the end user can create by using the web interface to configure the list. This list can then be saved as a list template. This list template is stored as an *.STP file in the list templates gallery of the Site Collection. This *.STP file is stored in the content database the Site Collection resides.


This file contains all the customizations made to the original List Definition, such as CAML and XML that describes the lists. The customizations require the same list definition to be installed on the server that was used to configure the list templates.

It is not as performant as a pure list definition as list definitions are cached on start of IIS on the web front ends while list templates are stored in the Content Database, They need to be fetched from the content database and merged with the list definition code at runtime to render the list.


Deciding Between List Definitions and List Templates

Custom list definitions hold the following advantages over list templates:

· Data is stored directly on the Web servers, so performance is typically better.

· A higher level of list customization is possible through direct editing of a Schema.xml file.

· Certain kinds of customization to lists require use of site and list definitions.


List definition disadvantages include the following:

· Customization of list definition requires more effort than configuring list templates.

· Editing a list definition after it has been deployed is difficult.

· Doing anything other than adding code can break existing sites.

· Customizing list definitions requires access to the file system of the front-end Web server.


List templates hold the following advantages over customization of list definitions:

· List templates are easy to create.

· Almost anything that can be done in the user interface can be preserved in the template.

· List templates can be modified without affecting existing sites that have been created from the templates.

· List templates are easy to deploy.


List template disadvantages include the following:

· List templates are not created in a development environment.

· List templates are less efficient in large-scale environments.

· If the List definition on which the list template is based does not exist on the front-end server or servers, the list template does not work.