Share via


SharePoint 2010: Choosing the Correct API

Introduction

SharePoint has several different API's (Application Programming Interface). This article outlines reasons to help you decide which API is correct choice (or best fit) for your solution or project.

Available API's

  • SharePoint object model
  • SharePoint web services
  • SharePoint Client object model
  • Custom WCF service around server-side object model

Server-Side Object Model

Advantages

  • Server-side API is more comprehensive 

Disadvantages

  • the server-side object model provides the most extensive set of options for developing customization's, but it can only be used on computers that are running a version of SharePoint 2010

Web Services

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.

Client Object Model (CSOM)

This API combines most of all the features of the web services, so you will not have to make multiple soap requests to accomplish the same thing. The CSOM also batches up API calls into one request when you call ExecuteQuery. You will not be able to replicate this good performance with your own custom WCF service. There are few things that the CSOM does not do. One is cross site collection searching, term set management, and user profile management.

Custom WCF Service as Wrapper for Server-Side Object Model

my preference lies in building a custom WCF wrapper. Not only do I find the client object model sometimes somewhat odd to program against (but hey, that's personal), you regularly meet some limits where you don't expect them, not only in the areas mentioned by Steve (one example is web part interaction). For me, it can have several important advantages to create a custom WCF, mainly:

Other Languages

This article is also available in the following languages

See Also