Discussion on the new features of the Client Object Model (Client OM) in SharePoint 2010.
Presented at SharePoint Saturday Richmond 11/18/2009
Presented at SharePoint Saturday Virginia Beach 1/13/2010
Presented at SharePoint Saturday Boston 2/27/2009
1. AN INTRODUCTION TO THE NEW CLIENT OBJECT
MODEL
IN SHAREPOINT 2010
OR: WE DON’T NEED NO STINKIN’ GOLD-PLATED WEB-SERVICES!
2. Developing applications using
the SharePoint 2010 Client APIs.
G. Scott Singleton - Principal SharePoint Architect
i3solutions, Inc. - Sterling, VA.
Involved with SharePoint 2010 since May 2009
One TAP project and three current RTM projects
3. Learn from yesterday, live for
today, hope for tomorrow.
The important thing is not to
stop questioning.
Albert Einstein
4. I do “Code Solutions”.
None of this “No-Code”
crap.
There’s no way to take advantage of all of the rich client
experience gains in SP 2010 without code.
Why waste 40 hours looking for that no-code solution
when you could have developed the code-solution in
1/3 the time.
Hell, that’s why we make the big money.
5. Gotcha! Bet you didn’t think you would see the
new SharePoint pie in a developer session eh?
7. Accessing SharePoint Data
SharePoint Data (SQL)
SharePoint API SharePoint /
Server
SharePoint Custom Web Applications
Web Services Services
Your Client
Application
9. Tomorrow
‘RESTful’ Architecture
ADO.NET Data Services Framework
Formerly Known as “Astoria”
ADO.NET Data Services (CTP 2) Required on Server for Beta, RTM for
Release Candidate
JSON - JavaScript Object Notation
Client Object Model (Client OM)
13. Using the REST API
Representational
State Transfer
REST API provided through ADO.NET Data Services
Framework via WCF
/_vti_bin/ListData.svc is base service -- and it is case
sensitive
Can be used to bind to data services from client
applications with ADO.NET Data Services CTP 2
(or Data Services Update for .NET 3.5 SP1 )
14. A Quick note on Data
Services Compatibility
If you want to try out Data Services with the SharePoint 2010 Beta today you
have to use CTP2 of Data Services v1.5, because unfortunately the Data Service
RTM version, aka the Data Services Update for .NET 3.5 SP1 is incompatible with
the SharePoint 2010 Beta.
This is a point in time issue – when SharePoint RTMs it will work seamlessly with
the Data Services Update for .NET 3.5 SP1.
Alex James
Program Manager
Microsoft
18. Available QueryString
parameters
Default Parameter is item ID and enclosed in parens. ( Links(1) )
$filter - formatted like a CAML query
$expand - returns parent object (lookups, relations, etc)
$orderby - Sets return order by
$skip - Skips x items
$top - Returns top x ($top=2 returns top 2)
Can be stacked together
example: $orderby=Title&top=1
19. Client Object Model
Simple API to Add, Retrieve and Update data within
SharePoint 2010
Supports three major client development languages.
.NET CLR
JavaScript
Silverlight CLR
Gives you consistency and efficiency across the
development platforms
Unfortunately you’re still stuck with CAML for the
initial query to the server.
20.
21. Benefits of Client Object
Model
A Richer User eXperience (UX) than the simple
WebForms post-back model
Reduces impact on server by executing more
processes on the client’s machine
Normalizes calls between three available client
architectures.
Batches calls to reduce roundtrip
Provides Asynchronous ability for better UX
performance
Late stage data retrieval - returns all the data you
need, but only the data you need.
25. Using the client OM in
SilverLight
Silverlight is Asynchronous by Nature
Provides both an ExecuteQuery() and
ExecuteQueryAsync() Method -- but if you’re updating
the UI you MUST use the Asynchronous call.
Must provide success and failure callbacks for UI
Updates
Must hand off UI work to the dispatcher
Similar nomenclature to the .NET CLR
26.
27. DEMO - .NET and Silverlight
CLR - Cross your fingers!
28. Client Object Model Summary
Similar constructs and naming convention as Server
Object Model; reduces developer ramp-up time.
Reduction of server overhead by offloading processes
onto the client
Improves the client’s UX dramatically
Reduction of round-trips to server via late-stage
batching
No need for messy custom web services
All around cool
29. Don’t forget to fill out your
speaker survey forms.
scottsingleton on twitter - follow me foo
scott.singleton@i3solutions.com
http://www.i3solutions.com
Looking for SharePoint Consulting? -- Call us!
Looking for a challenging career in SharePoint
development with one of THE leaders in Microsoft’s
Mid-Atlantic region? -- Call us!