Wednesday, June 17, 2015

When to Choose SPServices vs. the Client Side Object Model (CSOM)



SPServices

Pros
 - A wide range of SharePoint functionality is exposed with the SOAP Web Services, much of which is not available in CSOM
 - Allows anonymous access (assuming it is enabled for the underlying objects)
 - Works cross-site and cross-domain, assuming that the authentication model you are using allows it
 - Simpler syntax than the CSOM. Simply pass the required parameters to the Web Service operation, e.g., GetListItems
 - Built on top of jQuery, which is very good at ensuring cross-browser compatibility
 - Regularly updated and refined to be compatible with new versions of jQuery and to add new functionality based on user input
 - Works identically in SharePoint 2007 and 2010

Cons
 - The SOAP Web Services which SPServices wraps is “old” technology which only returns XML
 - Because the SOAP Web Services are older technology, they may not be supported as long as CSOM

CSOM

Pros
 - Provides access to the “modern” RESTFul Web Services which return JSON or XML based upon your need
 - Coding patterns mirror .NET, which may make more sense to .NET developers

Cons
 - No anonymous access
 - No cross-site or cross-domain capabilities
 - Complicated syntax which mirrors .NET coding patterns, which may make less sense to Web developers
 - Have to create your own success and failure methods

References: http://www.sharepointhillbilly.com/Lists/Posts/Post.aspx?ID=15

No comments:

Post a Comment