Deciding Which SharePoint 2010 API to Use

Learn when to use the three different kinds of APIs (server-side object model, managed client object model, and Web services) that Microsoft SharePoint 2010 provides.

Última modificación: jueves, 08 de septiembre de 2011

Hace referencia a: SharePoint Foundation 2010

En este artículo
Server-side Object Model
Client Object Model
SharePoint 2010 Web Services

Microsoft SharePoint 2010 provides three sets of APIs for developing extensions and custom solutions by using SharePoint capabilities: the server-side object model, the managed client object model, and Web services. Each API has advantages and limitations that you need to understand before you begin planning and developing custom solutions. For example, the server-side object model provides the most extensive set of options for developing customizations, but it can be used only on computers that are running a version of SharePoint 2010. The following sections describe the three sets of APIs and the contexts in which to use them.

Server-side Object Model

The server-side object model provides the most extensive set of options for extending the capabilities of SharePoint 2010. It consists of every API that is documented in a class library in the Referencias del servicio web y las bibliotecas de clases de SharePoint 2010 section of the Kit de desarrollo de software (SDK) de Microsoft SharePoint 2010.

Any application that uses these APIs must be physically deployed on the server. See Configuración del entorno de desarrollo para SharePoint 2010 en Windows Vista, Windows 7 y Windows Server 2008 for guidance on and options for setting up a development environment. In terms of security, these APIs usually have a high level of access, but see Sandboxed Solutions for limitations that are related to sandboxed solutions. This set of APIs provides access to the largest number of features and capabilities. In Microsoft SharePoint Foundation 2010, many of the server-side APIs reside in the Microsoft.SharePoint assembly (Microsoft.SharePoint.dll); in Microsoft SharePoint Server 2010, many of these APIs reside in the Microsoft.Office.Server assembly (Microsoft.Office.Server.dll). However, you must look at the documentation for each type and member in each API to determine which assembly to reference.

Client Object Model

The client object model allows you to integrate SharePoint 2010 capabilities into script that executes in the browser, code (no earlier than Microsoft .NET Framework 3.5) that executes in a .NET Framework managed application, or code that executes in a Microsoft Silverlight application. The APIs in the client object model are wrappers around a custom Web service that dispatches the calls to the server-side object model. They generally provide better performance than the SharePoint 2010 Web services because they batch requests and perform all operations asynchronously. They also feature design traits (such as object model hierarchy, object identity, data retrieval semantics, client context, infrastructural client objects, collections, and exception handling) that are familiar to SharePoint 2010 developers, and to Microsoft ASP.NET developers more generally. SharePoint 2010 provides an unmanaged ECMAScript (JavaScript, JScript) object model for script that executes in the browser. The unmanaged client object model is a good option for Web developers who are not familiar with ASP.NET development. The client object model focuses on the most relevant APIs for client-side development, and does not contain all the types and members that are represented in the server-side object model.

The client object model is designed for use in remote client-side solutions that run on computers where SharePoint 2010 is not installed. See Modelo de objetos cliente administrado for more information about the client object model and how to use it. The types and members in these APIs are documented in Biblioteca de clases de cliente (for code that executes in a .NET managed application or in a Microsoft Silverlight 2.0 application) and Biblioteca de clases de ECMAScript (for code that executes in the browser).

SharePoint 2010 Web Services

The SharePoint 2010 Web services allow you to integrate SharePoint capabilities into code that runs remotely in client-side or server-side applications that run on computers where SharePoint 2010 has not been installed. SharePoint 2010 provides a limited set of REST interfaces for developers who are familiar with that standard. The Web services provide a fuller range of capabilities than the managed client object model, but they do not provide the same performance and design advantages, such as batching and exception handling. When you develop client-side applications, you should use the managed client object model whenever possible.

The SharePoint 2010 Web services APIs are documented in Servicios web de SharePoint 2010 and in Interfaz de REST de SharePoint Foundation.

Vea también

Conceptos

Configuración del entorno de desarrollo para SharePoint 2010 en Windows Vista, Windows 7 y Windows Server 2008

Uso del modelo de objetos de servidor de SharePoint Foundation

Arquitectura de servidor y sitio: introducción al modelo de objetos

Otros recursos

Sandboxed Solutions

Modelo de objetos cliente administrado

Servicios web de SharePoint 2010