SharePoint Client Object Model is a set of libraries and classes with which you can consume SharePoint data through a specific object model, which can be considered a subset of the SharePoint Object Model.
The client object model exposes a subset of the API that the server object model does, mainly focused on the Site-Collection level and lower.
The design of the client object model is to batch interaction with SharePoint to minimize the number of
round trips that it takes to interact with SharePoint services for common actions.
Multiple platform support :
Managed Client
Silverlight
ECMA
The Client Object Model uses a client runtime proxy that communicates with a Windows Communication Foundation (WCF) service. The service is located at /_vti_bin/client.svc.
To communicate, the client proxy sends batched XML commands and the WCF services respond with a result formatted using JavaScript Object Notation (JSON).
Because all commands are batched together and the JSON notation is a compact form, the Client Object Model bandwidth use is kept to a minimum.
Assembly Requirements
1. Managed Client Object Model
Microsoft.SharePoint.Client.dll
Microsoft.SharePoint.Client.Runtime.dll
These files are located in the \Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI folder.
2. Silverlight Client Object Model
Microsoft.SharePoint.Client.Silverlight.dll
Microsoft.SharePoint.Client.Silverlight.Runtime.dll
These files are located in \Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\LAYOUTS\ClientBin
The reason for these .dlls being installed in a different location is due to how Silverlight works—
these .dlls are deployed to the same folder that some of the Silverlight building blocks are located in,
which makes it easier to access them from Silverlight.
3. ECMAScript Client Object Model
A set of .js files
SP.js
SP.Core.js
SP.Ribbon.js
SP.Runtime.js
JavaScript files that are located in the \Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\LAYOUTS folder
These .js files are automatically downloaded to the browser when a use browses to SharePoint page.
There are also assemblies for working with REST/OData end points and Windows Phone.
There are also assemblies for working with REST/OData end points and Windows Phone.
Managed Client Object Model
using Microsoft.SharePoint.Client;
private void Form1_Load(object sender,
EventArgs e)
{
ClientContext ctx = new ClientContext
("http://shalvin");
Site site = ctx.Site;
ctx.Load(site);
Web wb = site.RootWeb;
ctx.Load(wb);
ctx.ExecuteQuery();
listBox1.Items.Add(ctx.Url);
listBox1.Items.Add(site.Url);
}






