Conditional scope: As in standard development done on the server, coding conditions by relying on exceptions being thrown is not a great idea. Thankfully, the client object model gives you a way to execute code conditionally using the ConditionalScope object. When executing code on the server, this object lets you execute code provided a certain condition is met. The ConditionalScope object is available in both of the managed client object models but not in the ECMAScript client object model.
Authentication: The client object models have a default authentication built in. Both of the managed client object models authenticate using the default credentials of the authenticated user running the code. However, in the case of the .NET client object model, you can use the ClientContext.AuthenticationMode property to change the authentication to use anonymous or forms-based authentication.
Depending on the authentication mode specified, the client object model calls the SharePoint authentication Web service (http://[...]/_vti_bin/Authentication.asmx), then obtains and sets a cookie that it uses for future calls.
Changing the authentication mechanism is allowed only in the .NET client object model. The ECMAScript client object model uses the authentication of the page it's hosted within; it cannot change its authentication.
Implementing the Client Object Model
Before using the client object model, you need to know how an application must be configured to leverage the model. Although the three client object models share similarities, a few subtle differences exist in terms of limitations and implementations.
.NET client object model: The .NET client object model is designed for use in applications that will run off the SharePoint servers and connect to SharePoint remotely. This could include applications running on a laptop or integrated into a bigger system that needs to communicate with SharePoint. These applications can be either x86 or x64 and require the .NET Framework 3.5 SP1 or higher.
Custom .NET applications will need to add references to two assemblies in order to use the client object model. These two assemblies are found on the SharePoint server: c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI:
- Microsoft.SharePoint.Client.dll—contains the client object model.
- Microsoft.SharePoint.Client.Runtime.dll—handles all communication between the client and SharePoint server.