Advantages and Disadvantages of Client Object Model

I have been implementing Client Object Model (COM) extensively in Silverlight as well as in ECMAScript. I have failed many times in accomplishing certain tasks and succeeded many times too. You may love or hate COM but you cannot ignore it if you are a SharePoint 2010 developer.

So, I’m going to list out the advantages and disadvantages of COM that I have been facing while implementing it. Let us look at the advantages first.

Advantages:

  1. As mentioned everywhere using COM we can access the SharePoint data from the client side browser itself with Silverlight and ECMAScript applications.
  2. 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.
  3. 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.
  4. 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.
  5. No IISREST is required while deploying a Silverlight or an ECMAScript application implemented with COM.
  6. 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.
  7. 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.

These are the advantages and disadvantages that I have faced. I will update more when I face any.

Advertisements

13 thoughts on “Advantages and Disadvantages of Client Object Model

  1. Hi,
    I couldn’t be idle without appreciating you.Not only for sharing the info,but also highlighting the important points in bold.Thank you so much

    • pal,
      It means, if you are writing your COM code in one site collection then in that code you cannot access\retrieve a list or a library or any other data from another site collection.

  2. Thanks for the post, It helps me to understand COM.
    Plz correct, if my understanding of first Disadvantages is wrong. The client object model would open a security hole and then everybody could write and execute code as an administrator.

    • Ganesh, No you have got it wrong. The point says that it is not possible to create any security hole at all in COM. The permission remains the same as that of the user and you cannot change it at all as in server object model for any purpose.

  3. Pingback: SharePoint 2010 Object Model | Sanjay Adsure

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s