Monday, August 6, 2018

SharePoint Rest API and client object Model Programming


Excellent Thinking for developing  SharePoint using Rest API or CSOM Although there are some differences
between two topics we will discuss in this post :
Rest API: that described a way to share data over HTTP using OData  (Open Data Protocol). SharePoint 2013 using WCF data service 5.0 to build Rest API.
advantages :
- use standard protocol so easy to develop and learn how to do.
- Rest Implementation coverage a huge area of SharePoint 2013.
disadvantage:
- not support for taxonomy fields.
- not support for Workflows services.
- not support for adding batch items with a single request.
CSOM: that describe specific API developed by Microsoft that depend on SharePoint.Net client object model so you must learn how to use from Microsoft and you need to follow the following steps to develop using CSOM API :
1-  create a client context
2- use load to query data you want
3- execute a query
4- save data
the SharePoint.Net client object model bundles up the above commands into XML and
sends them to the server. The server receives this request and makes appropriate calls into the object model
on the server, collects the responses, forms them into JavaScript Object Notation (JSON), and sends that
JSON back to the SharePoint.Net client object model.
advantages:
- minimum round trips to server i.e create a list with custom fields you can do it in one round trip
to the server
- adding batch items in a list in one single request.
- better performance.
- managing request and response using SharePoint so you don't care about it.
disadvantage :
- not easy development (bad documentation).


I already mixed (Rest API & CSOM) in my solutions to get better performance and rapid development and
it works fine for me

0 comments:

Post a Comment