Sunday, February 6, 2011

Basics of Client Object model in SharePoint 2010

When writing some applications for SharePoint 2010, I have noticed this nice thing called Client Object model. In here I am going to describe what Client Object model is per my understanding. Since I am a beginner for SharePoint please feel free to correct me if I am wrong.

SharePoint 2010 has introduced developers a nice concept called Client Object model which can be used to do variety of customizations in SharePoint. Previous versions of SharePoint such as SharePoint 2007 had no Client Object model available.

The main reason for Microsoft to introduce such a concept was, the developers need of different kind of Web Services that interacts with SharePoint and It’s not possible for Microsoft to Develop a Web Service per developer’s need. Even if Microsoft has provided a lot of Web Services that interacts with SharePoint, but because of the developer’s need of customized web services has made most of the out of the box web services unusable.

The most important part of using the client object model is developers can build remote clients without using the SharePoint out of the box Web services and without implementing the communication architecture.

Basically Client Object model enables developers to build solutions that consume SharePoint data and objects from applications that do not run on a SharePoint server. The best example would be a Silverlight application.
In Client Object Model Client can be in one of these type of applications.
  • Managed Client (Assembly File – Microsoft.SharePoint.Client)
  • Silverlight (Assembly File – Microsoft.SharePoint.Client.Silverlight)
  • ECMAScript (Assembly File – SP.js)
SharePoint 2010 client Object Model is written based on .Net CLR, so we can write custom code in C# or VB for SharePoint 2010 platform. For this we need following dlls , located at “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI” folder.
  • Microsoft.SharePoint.Client.dll
  • Microsoft.SharePoint.Client.Runtime.dll

Similarities of SharePoint Client Object Model


Server (Microsoft.SharePoint)
Client Object Model
SPContext
ClientContext
SPSite
Site
SPWeb
Web
SPList
List
SPListItem
ListItem
SPField
Field


Please feel free to correct me and Give me your feedback.

Happy Coding.

Regards,
Jaliya

2 comments:

  1. Thanks so much for posting all of the awesome info! Looking forward to seeing more posts! SharePoint was introduced in 2007 but the 2010 version offers a number of improvements and promises to be even more competitive than before.

    ReplyDelete
  2. Thank you so much for the nice comment Sarron. Yes, I am hoping to post new things as I move forward. Keep in touch.

    ReplyDelete