none
Sharepoint 2010 Object Model RRS feed

  • Question

  • Hello,

    What is the difference between Client Object Model and Server Object Model of Sharepoint 2010? An online tutorial is highly apprecieted.

    Thank you,

    Suma

    Friday, June 17, 2011 6:54 PM

Answers

  • Server Object Model:

      Can only be run from the server (web page in SharePoint, a console application running on the server, etc)

      Can access all SharePoint functionality

      Is "real time"   -  retrieving an object (a web or list) provides immediate access to the object's properties

     

    Client Object Model:

      Can only access a subset of the full SharePoint functionality

      Is batch oriented - you create objects, set properties then call ExecuteQuery to fetch or update the properties  

      Can be run from anywhere, but typically from someplace other than the server. Possiblities include:

        Windows forms application (C#, VB, etc) on a remote PC

        Console application (C#, VB, etc) on a remote PC

        A client browser using JavaScript and the JavaScript Client Object Model API

        A client browser using Silverlight and the managed (.Net) Client Object model

        Any place you might have considered using a SharePoint web service call in 2007


    As far a performance... code run on the server will always be faster as there are no remote calls across a network or internet.

     

    There are many articles on the web on this topic. Just search for "sharepoint client object model vs server object model".

    Here's few:

    http://msdn.microsoft.com/en-us/library/ee537564.aspx

    http://msdn.microsoft.com/en-us/library/ee537247.aspx

    http://weblogs.asp.net/shailesh/archive/2010/07/07/sharepoint-2010-introduction-to-client-object-model.aspx

     

     


    Mike Smith TechTrainingNotes.blogspot.com
    • Proposed as answer by SivaSP M Sunday, June 19, 2011 1:14 AM
    • Marked as answer by Porter Wang Monday, June 20, 2011 2:01 AM
    Saturday, June 18, 2011 1:42 AM

All replies

  • Please look at the SharePoint 2010 SDK available here

    Server Object Model is where you write C# code  and create assemblies. Client Object Model is where you write code using ECMAScript which has been introduced in SharePoint 2010. More details can be found in SDK... 

    Hope this helps. 

     


    Thanks, Mayur Joshi
    Friday, June 17, 2011 7:56 PM
  • The most big difference in here is when developing using

    Server OM: less performance because of going back and coming from server with every request. BUT

    Client OM: code runs on client side.

    Also Server dll which is Microsoft.SharePoint.dll its size is around 16MB BUT

    Client OM dll is about 282 KB

    So difference in size and differs in performance.

    -----------------

    The Other important and new thing about it is developing SharePoint Remotely ! can only be done using Client OM. yes you can develop in visual studio to your SharePoint server Remotely, BUT when it comes to Server OM, you must have a SharePoint farm  on the current development farm.


    Mai Omar Desouki | Software Consultant | Infusion | MCP, MCTS, MCPD, MCITP, MCT Microsoft Certified Trainer & MCC Microsoft Community Contributor | Email: mai_omar_86@live.com
    Friday, June 17, 2011 10:14 PM
  • Server Object Model:

      Can only be run from the server (web page in SharePoint, a console application running on the server, etc)

      Can access all SharePoint functionality

      Is "real time"   -  retrieving an object (a web or list) provides immediate access to the object's properties

     

    Client Object Model:

      Can only access a subset of the full SharePoint functionality

      Is batch oriented - you create objects, set properties then call ExecuteQuery to fetch or update the properties  

      Can be run from anywhere, but typically from someplace other than the server. Possiblities include:

        Windows forms application (C#, VB, etc) on a remote PC

        Console application (C#, VB, etc) on a remote PC

        A client browser using JavaScript and the JavaScript Client Object Model API

        A client browser using Silverlight and the managed (.Net) Client Object model

        Any place you might have considered using a SharePoint web service call in 2007


    As far a performance... code run on the server will always be faster as there are no remote calls across a network or internet.

     

    There are many articles on the web on this topic. Just search for "sharepoint client object model vs server object model".

    Here's few:

    http://msdn.microsoft.com/en-us/library/ee537564.aspx

    http://msdn.microsoft.com/en-us/library/ee537247.aspx

    http://weblogs.asp.net/shailesh/archive/2010/07/07/sharepoint-2010-introduction-to-client-object-model.aspx

     

     


    Mike Smith TechTrainingNotes.blogspot.com
    • Proposed as answer by SivaSP M Sunday, June 19, 2011 1:14 AM
    • Marked as answer by Porter Wang Monday, June 20, 2011 2:01 AM
    Saturday, June 18, 2011 1:42 AM
  • Hi,

    You can find the difference at following links:-

    http://social.msdn.microsoft.com/Forums/is/sharepoint2010general/thread/dab21b22-2858-4919-a7a4-bf0fbb89df6a

    http://siggaard.wordpress.com/2011/02/21/client-object-model-in-sharepoint-2010/

    Saturday, June 18, 2011 5:42 AM
  • http://praveenbattula.blogspot.com/2010/02/sharepoint-2010-complete-details-about.html

     

    http://www.a2zdotnet.com/View.aspx?Id=177

     

    http://www.codeproject.com/Articles/60348/SharePoint-2010-Client-Object-Model-for-JavaScript.aspx

     

     

    Saturday, June 18, 2011 7:31 AM