Social Icons

Pages

Monday, April 22, 2013

Share Point Integration

Microsoft SharePoint 2010 provides three solutions for integrating share point capabilities into code.
  1. The object model
  2. The client object model
  3. Web services


SharePoint Object Model & Client Object Model
SharePoint Object Model is a .NET based application programming interface (API) which can be used to communicate with all SharePoint components like Web Applications, Site Collections, Sites, Permissions, Roles, Users, Change Logs, etc.


The Object Model is provided only for server side programming. It can only be used when the application is run on a server in the SharePoint farm. It cannot be executed remotely. Microsoft introduced a new object model known as Client Object Model, which can be used to work remotely with SharePoint. The client object model is designed for use in remote client-side solutions that run on computers where SharePoint 2010 is not installed.


The Client Object Model provides almost all the programming features of the Server Object Model plus advantages in deployment. The Client OM (Client Object Model) is being used as the core programming aid for SharePoint 2010.The Client Object Model proxies are based on the Microsoft.SharePoint.dll.


The Client Object Model has three separate object models,
     1. .Net CLR
The .Net CLR version is used to create applications such as Win Forms, Windows Presentation Foundation (WPF), and console applications, as well as Power Shell scripts.


     2. Silver light application
The Silver light version works with both in-browser and out-of-browser Silver light applications.


    3. JavaScript
The JavaScript version enables your Ajax and jQuery code to call back to SharePoint.


  For example, in the server object model you have:

  • Microsoft.SharePoint.SPSite
  • Microsoft.SharePoint.SPWeb
  • Microsoft.SharePoint.SPList
In the client object model you have:
  • Microsoft.SharePoint.Client.Site
  • Microsoft.SharePoint.Client.Web
  • Microsoft.SharePoint.Client.List
 The following table shows the comparable objects in SharePoint Object Model and Client Object Model.
       

 Web Services
SharePoint provides a set of Web Services that 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.

Web Service in general is slow when compared to other binary communication mechanisms like .NET remoting, Similarly  SharePoint Web Service is also slower if compared with Object Model.

If the Web services did not provide the necessary capabilities, you could write server-side code to provide a new Web service (an even more difficult task). Some IT departments disallow server-side code, or allow only code that is written by the IT department so that sometimes that was not an option. The SharePoint Foundation 2010 managed client object model enables new kinds of applications and makes it easier to write client-side code that interacts with SharePoint content.


My suggestion would be use object model when applications run on the server in the SharePoint farm and use Client Object Model for the remote access where SharePoint is not installed.

Reference :