R – Querying list items and using SharePoint web services vs the object model

performancesharepointweb services

My company is looking into writing a custom application that will need to perform many list item queries across multiple site collections. It will need to run for WSS 3.0 and it 'would be nice' if it worked on WSS 2.0 as well. It won't be designed for MOSS/SPS but again it 'would be nice' if it worked on these platforms. There is no restriction on which .NET version should be used for the solution.

For this type of application, what would be better: the object model/API or SharePoint web services? The primary factor I'm considering is performance, followed by features and functionality. Thanks!

Best Answer

Object model is better as you can gain access to additional features and the full detail of the list items, such as the version history.

The object model is also better for performance (as long as you dispose() your spsite and spweb objects properly).

The Sharepoint object model has some differences between 2 and 3, but if you look at the reference for v2 then it will also work fully with v3.

The web services have not changed at all between v2 and v3, which explains why they do not have any new features of v3.

The reason the object model will win on performance is that you will not be serialising the data as Xml and then transmitting a large chunk of Xml, and then deserialising the Xml. The object model spares your memory and bandwidth.