CSOM vs JSOM vs SSOM vs REST

Introduction

In this article we will explore different hosting types and technology abbreviations used in SharePoint 2010/2013 and elsewhere too. Useful API reference of the most frequently used types and objects implemented in Server object model (SSOM) and at least one client programming model: .NET client-side object model (CSOM), JavaScript object model (JSOM), and/or REST. Here's the difference between CSOM/ JSOM/ SSOM/ REST.

image

Model Types

  • CSOM:

    CSOM core assembly is Microsoft.SharePoint.Client.Runtime.dll and Microsoft.SharePoint.Client.dll, which stands for Client-Side Object Model. It is a web service based API of SharePoint. It allows access to SharePoint data and features from remote clients. CSOM was introduced in SharePoint 2010 and greatly enhanced in SharePoint 2013.

    SP.ClientContext.get_current() for normal use. New SP.ClientContext('url...') for specific SPWeb.

  • SSOM:

    Server Object Model core assembly is Microsoft.SharePoint.dll which is installed in the Global Assembly Cache. The Server Object Model will be executed in the server side & it provides rich set of classes in representing & manipulating SharePoint objects. Must be deployed on same farm Server-side object model. C# (or Visual Basic) uses only Microsoft.SharePoint (14) DLL. Must be deployed on same farm.

  • REST:

    The SharePoint REST interface is based on the REST-based Open Data protocol (OData) which is a platform-independent open standard. REST in 2010 is only for ListData.svc. Note that SPServices (jQuery plugin) utilizes the.asmx services in _/vti/bin , such as /_vti_bin/Webs.asmx.

table

image

Model Types

CSOM:

CSOM, which stands for Client-Side Object Model, is a web services-based API of SharePoint. It allows access to SharePoint data and features from remote clients. CSOM was introduced in SharePoint 2010 and greatly enhanced in SharePoint 2013.

JSOM:

Access information in the host web using the Javascript Object Model, you need to use an SP.ClientContext.get_current() for normal use. New SP.ClientContext('url...') for specific SPSite. Note this works cross-SPSite in 2013.

SSOM:


Server Object Model is the most extensive API set available for SharePoint 2013. The core assembly is Microsoft.SharePoint.dll which is installed in the Global Assembly Cache. The Server Object Model will be executed in the server side & it provides rich set of classes in representing & manipulating SharePoint objects. Must be deployed on same farm.

REST:

The REST Services in SharePoint offer nearly the same functionality like JSOM. Furthermore, it is easier to use for a developer not coming from the SharePoint world since REST interfaces are standardized. This makes the choice of technology easier than for JSOM.

Hosting

SharePoint hosted:

A SharePoint-hosted app may provision basic resources into its app web such as HTML/CSS/JS files, site column/content type/list definitions, etc. Under no circumstances can server-side code run within a SharePoint-hosted app.

Provider hosted:

Provider-hosted apps for SharePoint include components that are deployed and hosted outside the SharePoint farm. They are installed to the host web, but their remote components are hosted on another server, but is meant to be hosted more manually (i.e. On Azure). So you fire up a web application, on any server, and then use S2S to connect to SharePoint.

Sandboxed:

Remnant from 2010, can be uploaded to Solution gallery. Support for limited subset of the SSOM. No file access, so can’t deploy anything to _layouts folder. If you use the limited SSOM-part (C#) your solution will be considered deprecated. Support for templates such as list templates and content types, deployed directly to host web.

Farm solution: Full access, deploy through PowerShell.

table

Note:

Microsoft officially announced the discontinuation of Autohosted apps model in SharePoint Online/Office 365 after it has been tested for the last few months.

Up Next
    Ebook Download
    View all
    Learn
    View all