2024: Domino Containers - The Next Step. News from the Domino Container commu...
SharePoint 2010 Application Development
1. Matt Bremer SharePoint Technology Specialist, Microsoft Corporation Twitter: @mattbremer SharePoint 2010 Application Development
2. SharePoint Momentum MORE THAN 80% RISE OF THE CLOUD Every day, for the past 5 years, we’ve added 20,000 SharePoint users! of large enterprise IT managers are at least in trial stage for cloud computing initiatives MORE THAN SharePointcustomers 17000 50 62% IF SHAREPOINT WERE A STANDALONE COMPANY IT WOULD BE ONE OF THE TOP software firms in the world andlarger than salesforce.com OF SHAREPOINT USERS use the product everyday 70% of Enterprise Customershave SharePoint
3. Developers! Developers! Developers! “SharePoint 2010 is much more attractive for developers than SharePoint 2007 ever was. I wouldn't be surprised to see many ASP.Net developers adopt SharePoint 2010 for their larger customized sites.” Robert Half Survey (2011)
4. Agenda Wake Up! Developer Productivity Rich Platform Services Flexible Deployment Best Practices Questions
5. SharePoint Application Landscape Business Collaboration Applications SharePoint Core Single WebPart Solutions Portal for LOB Application Data .NET | ASP.NET Customized SharePoint Server 2010 Workloads
6. Run on Premises or Hosted Patterns and Practices SharePoint Guidance Microsoft® Certification Exams Sandbox Solutions Microsoft Official Curriculum Run on SharePoint® Online Trained Administrators MSDN® Forums Composites Widely Deployed Platform Microsoft Partner Program Search Communities One WebPart Solutions Visual Studio® 2010 SharePoint Tools Content Business Collaboration Applications Team Foundation Server Sites Insights InfoPath 2010 Portal for LOB Application Data SharePoint Designer 2010 MSDN SharePoint SDK Customized SharePoint Server 2010 Workloads USER INTERFACE Web Parts Common SharePoint UI DATA LAYER SharePoint Lists Business Connectivity Services BUSINESS LOGIC ASP.NET Code Behind Workflows Event Receivers ACCESS CONTROL SharePoint Sites SharePoint Groups TARGET APPLICATION TYPES DEVELOPER TOOLS COMMUNITY ECOSYSTEM SHAREPOINT SERVER 2010 WORKLOADS EXECUTION ENVIRONMENT
10. Tools First Class SharePoint Developer Tools Faster Solution Debugging & Tuning Choice of Development Workstation Developer Productivity Comprehensive Data Access Line of Business Integration Workflow Advances Rich Platform Services Application Lifecycle Management Standardized Solution Packaging Deploy with Agility and Stability Flexible Deployment
11. Development on Windows 7 Either SharePoint Foundation or SharePoint Server Requires x64 OS Not Supported for Production Only for Stand Alone Installation Can be Disabled through Group Policy Certain Services like Performance Point Services require server OS Just for Developers Requires Following Install Guide in SDK or easy setup Windows 7
12. Visual Studio 2010 Develop, Deploy and Debug Web Part, BDC and Workflow designers Package and Deploy SharePoint projects Generate WSP for Production Deployment View SharePoint site in Server Explorer Team Foundation Server Integration Broad SharePoint Support Support for SharePoint Sandboxed Solutions Import WSP from SharePoint Designer including Workflow Build Workflow Steps for SharePoint Designer Extensibility for Development of Additional SharePoint Artifacts SharePoint Business Connectivity Services support Web Part Designer Project Types
13. SharePoint Designer 2010No code tool for SharePoint Free for creating and editing SharePoint artifacts New Tools BDC Entities List Schema Custom Actions Task / Approval Designer Improved Tools Workflow Designer Page Editor SharePoint Designer work can be upgraded to Visual Studio 2010 “Save site as template” in SharePoint Site Settings creates WSP WSP imports into Visual Studio 2010 as new project
16. SharePoint 2010 for Developers First Class SharePoint Developer Tools Faster Solution Debugging & Tuning Choice of Development Workstation Developer Productivity Comprehensive Data Access Line of Business Integration Workflow Advances Rich Platform Services Application Lifecycle Management Standardized Solution Packaging Deploy with Agility and Stability Flexible Deployment
17. Business Connectivity Services SharePoint List with External Data Read / Write SharePoint Foundation Built on the SharePoint 2007 Business Data Catalog Office Apps Client Runtime Offline Operations Cache Design Tools SharePoint Visual Studio 2010 Enterprise Search Development Platform Business Intelligence Enterprise content mgmt Collaboration social SharePoint Designer 2010 ECT Store Runtime Security Solution Packaging Out of the box UI Web 2.0 DB WCF Web Service .NET LOB
18. Demo Work with BCS in SharePoint Designer and Visual Studio
19. SharePoint List ImprovementsCollaborative Data Store Relationships with Cascade or Block Transacted Cascading Deletion Restriction of Deletion Validation with Excel Like Formula Formula-based Validation Ensure Uniqueness Lookup to Multiple Columns List Index Auto-Creation Scalability and Performance List Query Throttling And we keep from SharePoint 2007 Self Service List Creation Out of the Box List User Interface Built in Authorization Forms
20. XSLT Views for ListsView Design in UI and SPD Replaces CAML for Views CAML Still Used for Queries Better Performance Easier edit in SPD Ribbon UX: sort/filter/group, conditional formatting,… Simpler Coding Experience Standard language, shared default XSLT XSLT-based views are now default SharePoint Lists External Lists
22. Overview of Data Technologies REST APIs Strongly-typed lists ClientOM Weakly-typed lists Client-side Data Platform Farm Site List Data External Lists ServerOM Server-side Weakly-typed lists LINQ Strongly-typed lists New in 2010 Improved
23. LINQ to SharePointLanguage Integrated Query Entity based programming Strong Types and Intellisense Supports List Joins and Projections Join lists on lookup field between them Join multiple lists (A->B->C) Project any field from joined list in a query without changes in list schema Example fromoindata.Orderswhereo.Customer.City.Name == "London“selecto;
24. Client Object ModelRuns on Remote Machine Simple API to Add, Retrieve, Updateand Manage Data in SharePoint Commands batched for Performance SharePoint Data Consistent Efficient Client Application .NET CLR Silverlight CLR JavaScript
25. Client Object Model Sample .NET ClientContext context = newClientContext("http://server"); Web site = context.Web; context.Load(site); context.ExecuteQuery(); site.Title = site.Title + " and Client OM"; site.Update(); context.ExecuteQuery();
26. REST APIs ADO.NET Data Services REST Protocols Atom, JSON feeds SharePoint list data and Excel spreadsheets Integration with growing set of Microsoft REST Technologies
27. SharePoint Events ImprovementsReacting to Server Events Events Project Templates in Visual Studio 2010 After-Synchronous Events Simpler Event Behavior Site-scoped events Web creation events List creation events More User Interface Control Custom Error Pages
28. Workflow ImprovementsPopular and Successful Base in 2007 Visual Studio 2010 Initiation and Association Forms New Workflow Design Surface in SPD Import SPD Workflows into Visual Studio Build SPD Actions in Visual Studio Visio 2010 Workflow Design Browser Based Visualization High Privilege Workflows Control Where Service Runs Site Workflows Reusable Declarative Workflows List Workflow Event Receivers Pluggable Workflow Services Performance and Scale Fully Customizable OOB Workflow Approval Designer
30. SharePoint Service ApplicationsNew Service App Architecture Upgrade to Shared Service Provider from SharePoint 2007 More Flexible Services Model Builds on WCF Knowledge Management Extensible Administration Roles User Interface and PowerShell Browser Client App Consumer Web Part Consumer Web Part WFE SERVER Service Proxy WCF Contract APP SERVER Service Logic SQL SERVER Content Config Custom
31. SharePoint Service ApplicationsNew Service App Architecture Load Testing Common Infrastructure for “heavy” tasks Web Service & DB provisioning Settings Store Sharing & cross-farm service discovery Service instance discovery within a farm Round-robin load balancer Browser Client App Consumer Web Part Consumer Web Part WFE SERVER Service Proxy WCF Contract APP SERVER Service Logic SQL SERVER Content Config Custom
32. Ribbon and Dialog Framework Client Site Custom Actions in Ribbon Context Sensitive Ribbon The Ribbon Status Bar Notification Area
33. Ribbon and Dialog Framework Replaceable SharePoint OOB forms Open as Web Page or as Dialog Dialog Framework
34. Silverlight and SharePoint 2010New UI Option Media Player Web Part Organization Browser List and Site Creation Office Web Applications Silverlight Web Part Simple way to upload Silverlight CLR compatible Client Object Model Call SharePoint API’s REST APIs Simplifies List data access Support for remotely hosted Silverlight applications Delegated authentication/application principals
35. SharePoint 2010 for Developers First Class SharePoint Developer Tools Faster Solution Debugging & Tuning Choice of Development Workstation Developer Productivity Comprehensive Data Access Line of Business Integration Workflow Advances Rich Platform Services Application Lifecycle Management Standardized Solution Packaging Deploy with Agility and Stability Flexible Deployment
46. Upgrade and PackagingWSP as the SharePoint Installer WSS Solution Package (WSP) Visual Upgrade from version to version SharePoint UI Save To Template Better-defined Upgrade Semantics Declarative upgrade mappings Upgrade callouts for features Application discovery in SharePoint Sites WSPs as unified developer format Works in both site collections and on machine
47. Team Foundation ServerApplication Lifecycle Management Work Item Tracking Source Code Control Team Build Manage Test Cases Log Bugs Automated Testing Load Testing
48. Key Takeaways Visual Studio 2010 Install on Windows 7 SharePoint Designer 2010 Developer Dashboard Developer Productivity Business Connectivity Services LINQ, REST and Data Improvements Client Object Model Silverlight Web Part Workflow Improvements Rich Platform Services Team Foundation Server Sandboxed Solutions WSP Solution Upgrade SharePoint Online Flexible Deployment
55. Call to Action Leverage the OOB features of SharePoint SharePoint Advanced Developer Training on MSDN http://bit.ly/bBorC2 Get familiar with the SDK http://bit.ly/cEgLJ9 Patterns & Practices Guidance on MSDN http://bit.ly/a3u6aK SharePoint ALM Center on MSDN http://bit.ly/ddMqoZ SharePoint Disposal Patterns on MSDN http://bit.ly/ihP2UH Use SharePoint Dispose Checker Tool http://bit.ly/iiE3D6 Windows 7 Easy Setup http://bit.ly/b1GAqE
Incredible eco-system of partners and community. Anyone that has acquired SharePoint development skills probably already knows how desirable the skill set is by the amount of calls they receive from recruiters.
Categorized types of applications (app) built on SP (howdo people use SP?)Business Collaboration app – probably decided to use SP as base platform you will build your business app on Portal – SP is often a required place to expose data from back end systemSingle web part – one little extra piece of functionalityCustomized SP server workloads – extra tweaking to SP when customers want something not quite out of the box
Microsoft poster summarizes working with SharePointIncludes Target application types – from our last slideFor further information, audience can access a whitepaper by David Chappell on the SharePoint Development Platform
Traditional SharePoint & .NET Development in VSCompiledRuns Server-Side
Leverages “new” Web 2.0 approachNot compiledJavaScriptSilverlightRuns Client-Side
Part 1 – Developer Tools
Install SP 2010 on Windows 7 or Windows Vista – no longer need a server operating system.Applies to both SharePoint Foundation 2010 or SharePoint Server 2010Requires 64bit OSRequires installation steps to be followed for Windows 7 (does not do all pre-requisites for you unless you use easy setup)
Large new tool set in Visual Studio 2010, e.g. SharePoint packaging now built into Visual Studio, large amount of new project artifactsThis talk is an overview, each subject area is really an entire talk in itself!
Now a must have on a developers machine, for workflows, configuring business connectivity services etc…Has had a makeover!
Can turn on/off on demand.Can get additional details about a page using this tool.
Walkthrough of creating a Visual Web Part to show off the new tools available in Visual Studio 2010 for SharePoint 2010.
Part 2 – Improvements in the platform
Brings LOB data into SharePointIs the SP 2010 version of the Business Data CatalogData is now Read/WriteAvailable in SharePoint Foundation and offline in Office Client apps
Now has the ability to create relationships between lists that can either cascade deletes or block deletes.Can do lookups to multiple columns, get prompted to create sql type indexes.One caveat to large lists – there is now throttling for large views. If you build a web page that tries to display view over 5000 items, it will get blocked and you will have to handle it. Need to use indexers, different types of views or other strategies.
Recommended way for creating views in SP 2010 will be XSLT, not CAML.XSLT more of a generally used standard than CAML.CAML still valuable for queries.
Walkthrough of new list capabilities:Use Multiple value lookupsImplement relationships between listsSet validation rules on list columns
How you can access data in lists?2007 had SharePoint Server Object Model2010 now also has:REST APIs – ability to use REST style URLs and get data back in ATOM formatClient OM – you can make calls from a remote machine onto your SP 2010 box and get data backLINQ to SharePoint – can write and execute LINQ queries on the server side getting strongly typed behavior
Gives you build time Intellisense so you don’t find errors in your queries when you run your codeGives you an easy way to do joins and project fields from within the joins no matter how far the joins are through relationships that you call
Same concepts as Server OM, just done in a slightly different way – main difference being commands are batched up before sending across the wire.Not all of the Server API is replicated in the Client OM, but most isHas 3 types: .NET, Silverlight and JavaScript
Establish a client context, set up the Load methods (does not actually action anything at this point), call ExecuteQuery (gives the developer control over when the calls are made).Looks mostly like the standard SP Server API.
A good way to get images out of excel for adding into end user sitesIs a great way to lookup dataSupported using ADO.NET data services in SP (need these to use REST in SP)
New Project Wizard allows you to create an event handler for a specific event inside of SP and will add it into a feature and then WSP package.
A lot of new stuff here!
Walkthrough of creating a Workflow in Visual StudioDemonstrate new Site Workflow feature
New arch breaks the limitations of SSP model Now each “service” is independent and can be independently scaled & configured Web applications can be associated with any service application, not a pre-canned set of options Services can be shared across farms, facilitating complete service farms
Designed for running some applications/tasks that are too big for a code behind page and ASPS file.SP has an infrastructure because some of the services in SP are like this – e.g. Timer Service. Known as SSP in 2007.Made the services model more flexible to allow developers to create new services. Builds on WCF knowledge to create contracts and implement services in WCF. Has built in management functionality for dealing with these services.
Ribbon (like other Office products) - is context sensitive, uses AJAX, can work with Ribbon using JavaScriptStatus Bar – to give user some noticeNotification Area – can host pop ups you don’t need to keep on the screen
Dialog Framework allows you to create a dialog which doesn’t require a post back to the server.Dialogs are built using a SP User Interface (UI) web page, pass in a parameter so chrome isn’t shown.
SP has a Silverlight web part so you can host Silverlight apps in SharePoint without running the code on the server.
Part 3 – Flexible Deployment
Sandboxed Solutions – new technology designed to strike a balance between business agility (code customization), security and stability (server stability).Allows custom code to be run on the server but limiting its execution to a site collection. It monitors the resources the code uses and it restricts the API calls it can make using CAS. It can get shut down by the server if it breaks these rules.
With Sandboxed Solutions, Silverlight and Business Connectivity Services, SP Online becomes more flexible and useful for developers.The SP Online UI is the same a the SP Server version UI
A lot of binary custom code will, or is likely to continue to work, assembly versioning redirects have been created for many of the SharePoint DLLs.You are able to keep the V3 UI if you want to.WSP packaging has been enhanced to support upgrading your custom code (e.g. code callouts to callout to custom upgrade code).
If building a SP application in Visual Studio2010, you get access to all of the TFS and other application lifecycle management features in visual studio.
Use SPDispose CheckerUse using statementsDo not dispose of an object you did not create (e.g. SPContext.Current)Avoid greedy objects (e.g. AllWebs)
If SharePoint shows you a warning message, read it carefully!! It’s doing it for a reasons. Don’t go deleting a Title column or modifying a base content type without understanding the impact of those actionsThere are developers who do SharePoint and SharePoint developers. Do not think of a SharePoint app like a traditional ASP.NET app.Stay out of IIS!Do not modify the web.config! If you must modify the web.config, use the API, specifically (SPWebConfiguration) with a PowerShell cmdlet or custom STSADM extension so it is farm safe.