Monday, November 18, 2013

Client Object Model

Client Object Model is a  feature of SharePoint 2010. It provides programming in a SharePoint site using .Net Managed Code or JavaScript.

The Client Object Model provides almost all the programming features of the Server Object Model plus advantages on deployment. The Client OM (Client Object Model) is being used as the core programming aid for SharePoint 2010 and thus widely used in the market.

Advantages

  1. Less Deployment Hassles: Using the Client OM, you do not need to install the components required by Server Object Model. Thus the Client OM provides significant conveniences for the end user.
  2. Language Flexibility: We can use the following languages to work with the Client OM:

    a. Microsoft .Net
    b. Silverlight
    c. ECMA Script (JavaScript / Jscript)
     
  3. Query Speed Optimizations: In the Client OM, reduced network traffic is attained using Query Optimizations. Thus the user will feel reduced round trips and other advantages like paged results etc.
  4. everywhere using COM we can access the SharePoint data from the client side browser itself with Silverlight and ECMAScript applications.
  5. Web parts with very rich user interface can be developed with the help of Silverlight and jQuery. For example, we can create web parts like video and image galleries with beautiful animations where the videos and the images can be stored in the SharePoint libraries and retrieved using COM.
  6. COM along with JavaScript or jQuery can be implemented with just a Content Editor Web part within the browser or from the SharePoint designer without opening the Visual Studio. You can read about it here on how to do that.
  7. When we save your site as a template. The application developed with ECMAScript or Silverlight application implemented with Client Object Model would come along with the template which would be very helpful during migrations though we need to take care of any hard coded values.
  8. No IISREST is required while deploying a Silverlight or an ECMAScript application implemented with COM.
  9. We can have SharePoint accessed from the client desktop using Windows forms or WPF applications implemented with COM. We can develop desktop gadget kind of applications which would be displaying the new announcements added to the “Announcements” list.
  10. No SharePoint installation is required in the development machine. Only the dll’s are required if you are going to develop Silverlight applications.
Disadvantages

1.      We cannot elevate the privilege or Impersonate in COM as in Server Object Model. That is, we cannot use the RunWithElevatedPrivilege kind of a delegate. Therefore, the results retrieved using COM will always be security trimmed by default.
2.      The range of classes available to access SharePoint data is very limited in COM. For example, we do not have Classes for accessing User Profiles. We need to go for SharePoint web services.
3.      We cannot access the objects of another site collection in COM while implementing in Silverlight or in ECMAScript. We will get “The security validation for this page is invalid.” if we try to do so. So, we cannot develop applications to read the data from another site collection.
4.      Silverlight web parts fail to load by giving an error message saying “Could not download the Silverlight application or the Silverlight Plugin did not load. To re-configure the Web Part or to provide a different Silverlight application (.xap), open the tool pane and then click Configure.” when it takes more than 5 seconds to load.
5.      We cannot retrieve recurring events from a SharePoint calendar list in Client Object Model.

    0 comments:

    Post a Comment