You may also be interested in: SharePoint Hosting by Fpweb.net
Editor's note: Contributor SC Vinod is a SharePoint Developer at Hexaware Technologies. Follow him @scvinod
I have implemented the Client Object Model (COM) extensively in Silverlight as well as in ECMAScript. I've 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 the advantages and disadvantages of COM that I have faced while implementing it. Let's look at the advantages first.
- As mentioned often, when using COM we can access 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.
- When you save your site as a template. The application developed with an 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 applications implemented with COM. We can develop desktop gadget kind of applications which would display 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 the Server Object Model. That is, we cannot use the RunWithElevatedPrivilege kind of a delegate. Therefore, the result 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. Though it can be accomplished by using SharePoint web services.
- We cannot access the objects of another site collection in COM while implementing in Silverlight or in an 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.” if it takes more than 5 seconds to load. This means we have to finish loading the SharePoint data within 5 seconds.