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.
- As mentioned everywhere using COM we can access the SharePoint data from the client side browser itself with Silverlight and ECMAScript applications.
- 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.
- 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.
- No IISREST is required while deploying a Silverlight or an ECMAScript application implemented with COM.
- 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.
- No SharePoint installation is required in the development machine. Only the dll’s are required if you are going to develop Silverlight applications.
- 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.
- 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.
- 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.
- 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.
- 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.