SharePoint 2010 Application Development


Published on

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • 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.
  • If it’s not documented, it didn’t happen
  • SharePoint 2010 Application Development

    1. 1. Matt Bremer<br />SharePoint Technology Specialist, Microsoft Corporation<br />Twitter: @mattbremer<br />SharePoint 2010 Application Development<br />
    2. 2. SharePoint Momentum<br />MORE THAN<br />80%<br />RISE OF THE CLOUD<br />Every day, for the past 5 years, we’ve added 20,000 SharePoint users!<br />of large enterprise IT managers are at least in trial stage for cloud computing initiatives<br />MORE THAN <br />SharePointcustomers<br />17000<br />50<br />62%<br />IF SHAREPOINT WERE A STANDALONE COMPANY IT WOULD BE ONE OF THE TOP<br />software firms in the world andlarger than<br />OF SHAREPOINT USERS<br />use the product everyday<br />70%<br />of Enterprise Customershave SharePoint<br />
    3. 3. Developers! Developers! Developers!<br />“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.”<br />Robert Half Survey (2011)<br />
    4. 4. Agenda<br />Wake Up!<br />Developer Productivity<br />Rich Platform Services<br />Flexible Deployment<br />Best Practices<br />Questions<br />
    5. 5. SharePoint Application Landscape<br />Business Collaboration Applications<br />SharePoint Core<br />Single WebPart<br />Solutions<br />Portal for LOB Application Data<br />.NET | ASP.NET<br />Customized SharePoint Server 2010 Workloads<br />
    6. 6. Run on Premises or Hosted<br />Patterns and Practices SharePoint Guidance<br />Microsoft® Certification Exams<br />Sandbox Solutions<br />Microsoft Official Curriculum<br />Run on SharePoint® Online<br />Trained Administrators<br />MSDN® Forums<br />Composites<br />Widely Deployed Platform<br />Microsoft Partner Program<br />Search<br />Communities<br />One WebPart Solutions<br />Visual Studio® 2010 SharePoint Tools<br />Content<br />Business Collaboration Applications<br />Team Foundation Server<br />Sites<br />Insights<br />InfoPath 2010<br />Portal for LOB<br />Application Data<br />SharePoint Designer 2010<br />MSDN SharePoint SDK<br />Customized SharePoint Server 2010 Workloads<br />USER INTERFACE<br />Web Parts<br />Common SharePoint UI<br />DATA LAYER<br />SharePoint Lists<br />Business Connectivity Services<br />BUSINESS LOGIC<br />ASP.NET Code Behind<br />Workflows<br />Event Receivers<br />ACCESS CONTROL<br />SharePoint Sites<br />SharePoint Groups<br />TARGET APPLICATION TYPES<br />DEVELOPER TOOLS<br />COMMUNITY ECOSYSTEM<br />SHAREPOINT SERVER 2010 WORKLOADS<br />EXECUTION ENVIRONMENT<br />
    7. 7. Managed Code <br />
    8. 8. Trust?<br />GAC (Full Trust)<br />BIN (CAS)<br />
    9. 9. Unmanaged Code<br />
    10. 10. Tools<br />First Class SharePoint Developer Tools<br />Faster Solution Debugging & Tuning<br />Choice of Development Workstation<br />Developer Productivity<br />Comprehensive Data Access<br />Line of Business Integration <br />Workflow Advances<br />Rich Platform Services<br />Application Lifecycle Management <br />Standardized Solution Packaging<br />Deploy with Agility and Stability<br />Flexible Deployment<br />
    11. 11. Development on Windows 7<br />Either SharePoint Foundation or SharePoint Server<br />Requires x64 OS<br />Not Supported for Production<br />Only for Stand Alone Installation<br />Can be Disabled through Group Policy<br />Certain Services like Performance Point Services require server OS<br />Just for Developers<br />Requires Following Install Guide in SDK or easy setup<br />Windows 7<br />
    12. 12. Visual Studio 2010<br />Develop, Deploy and Debug<br />Web Part, BDC and Workflow designers<br />Package and Deploy SharePoint projects<br />Generate WSP for Production Deployment<br />View SharePoint site in Server Explorer<br />Team Foundation Server Integration<br />Broad SharePoint Support<br />Support for SharePoint Sandboxed Solutions<br />Import WSP from SharePoint Designer including Workflow<br />Build Workflow Steps for SharePoint Designer<br />Extensibility for Development of Additional SharePoint Artifacts<br />SharePoint Business Connectivity Services support<br />Web Part Designer<br />Project Types<br />
    13. 13. SharePoint Designer 2010No code tool for SharePoint<br />Free for creating and editing SharePoint artifacts<br />New Tools <br />BDC Entities<br />List Schema<br />Custom Actions<br />Task / Approval Designer<br />Improved Tools <br />Workflow Designer<br />Page Editor<br />SharePoint Designer work can be upgraded to Visual Studio 2010<br />“Save site as template” in SharePoint Site Settings creates WSP<br />WSP imports into Visual Studio 2010 as new project<br />
    14. 14. Developer Dashboard<br />Enable via STSADM:<br />stsadm -o setproperty -pn developer-dashboard -pvondemand<br />Enable via PowerShell:<br />$dash = [Microsoft.SharePoint.Administration.SPWebService]::ContentService.DeveloperDashboardSettings; <br />$dash.DisplayLevel = 'OnDemand'; <br />$dash.TraceEnabled = $true; <br />$dash.Update() <br />Quick Debug or Monitor Page Performance<br />
    15. 15. Demo<br />Visual Web Part in <br />Visual Studio 2010<br />
    16. 16. SharePoint 2010 for Developers<br />First Class SharePoint Developer Tools<br />Faster Solution Debugging & Tuning<br />Choice of Development Workstation<br />Developer Productivity<br />Comprehensive Data Access<br />Line of Business Integration <br />Workflow Advances<br />Rich Platform Services<br />Application Lifecycle Management <br />Standardized Solution Packaging<br />Deploy with Agility and Stability<br />Flexible Deployment<br />
    17. 17. Business Connectivity Services<br />SharePoint List with External Data<br />Read / Write<br />SharePoint Foundation<br />Built on the SharePoint 2007 Business Data Catalog<br />Office Apps<br />Client Runtime<br />Offline Operations<br />Cache<br />Design Tools<br />SharePoint<br />Visual Studio 2010<br />Enterprise<br />Search<br />Development<br />Platform<br />Business Intelligence<br />Enterprise content mgmt<br />Collaboration social<br />SharePoint Designer 2010<br />ECT Store<br />Runtime<br />Security<br />Solution Packaging<br />Out of the box UI<br />Web 2.0<br />DB<br />WCF<br />Web Service<br />.NET LOB<br />
    18. 18. Demo<br />Work with BCS in SharePoint Designer and Visual Studio<br />
    19. 19. SharePoint List ImprovementsCollaborative Data Store<br />Relationships with Cascade or Block<br />Transacted Cascading Deletion<br />Restriction of Deletion<br />Validation with Excel Like Formula<br />Formula-based Validation<br />Ensure Uniqueness<br />Lookup to Multiple Columns<br />List Index Auto-Creation<br />Scalability and Performance<br />List Query Throttling<br />And we keep from SharePoint 2007<br />Self Service List Creation<br />Out of the Box List User Interface<br />Built in Authorization Forms<br />
    20. 20. XSLT Views for ListsView Design in UI and SPD<br />Replaces CAML for Views<br />CAML Still Used for Queries<br />Better Performance<br />Easier edit in SPD<br />Ribbon UX: sort/filter/group, conditional formatting,…<br />Simpler Coding Experience<br />Standard language, shared default XSLT<br />XSLT-based views are now default<br />SharePoint Lists<br />External Lists<br />
    21. 21. Demo<br />Relational Lists and Validation<br />
    22. 22. Overview of Data Technologies<br />REST APIs<br />Strongly-typed lists<br />ClientOM<br />Weakly-typed lists<br />Client-side<br />Data Platform<br />Farm<br />Site<br />List Data<br />External Lists<br />ServerOM<br />Server-side<br />Weakly-typed lists<br />LINQ<br />Strongly-typed lists<br />New in 2010<br />Improved<br />
    23. 23. LINQ to SharePointLanguage Integrated Query<br />Entity based programming<br />Strong Types and Intellisense<br />Supports List Joins and Projections<br />Join lists on lookup field between them<br />Join multiple lists (A->B->C)<br />Project any field from joined list in a query without changes in list schema<br />Example<br />fromoindata.Orderswhereo.Customer.City.Name == "London“selecto;<br />
    24. 24. Client Object ModelRuns on Remote Machine<br />Simple API to Add, Retrieve, Updateand Manage Data in SharePoint<br />Commands batched for Performance<br />SharePoint Data<br />Consistent<br />Efficient<br />Client Application<br />.NET CLR<br />Silverlight CLR<br />JavaScript<br />
    25. 25. Client Object Model Sample .NET<br />ClientContext context =<br />newClientContext("http://server");<br />Web site = context.Web;<br />context.Load(site);<br />context.ExecuteQuery();<br />site.Title = site.Title + " and Client OM";<br />site.Update();<br />context.ExecuteQuery();<br />
    26. 26. REST APIs<br />ADO.NET Data Services REST Protocols Atom, JSON feeds<br />SharePoint list data and Excel spreadsheets<br />Integration with growing set of Microsoft REST Technologies<br />
    27. 27. SharePoint Events ImprovementsReacting to Server Events<br />Events Project Templates in Visual Studio 2010<br />After-Synchronous Events<br />Simpler Event Behavior<br />Site-scoped events<br />Web creation events<br />List creation events<br />More User Interface Control<br />Custom Error Pages<br />
    28. 28. Workflow ImprovementsPopular and Successful Base in 2007<br />Visual Studio 2010 Initiation and Association Forms<br />New Workflow Design Surface in SPD<br />Import SPD Workflows into Visual Studio<br />Build SPD Actions in Visual Studio <br />Visio 2010 Workflow Design<br />Browser Based Visualization<br />High Privilege Workflows<br />Control Where Service Runs<br />Site Workflows<br />Reusable Declarative Workflows<br />List Workflow Event Receivers<br />Pluggable Workflow Services<br />Performance and Scale<br />Fully Customizable OOB Workflow<br />Approval Designer<br />
    29. 29. Use Visual Studio and SharePoint Designer to create a Workflow<br />
    30. 30. SharePoint Service ApplicationsNew Service App Architecture<br />Upgrade to Shared Service Provider from SharePoint 2007<br />More Flexible Services Model<br />Builds on WCF Knowledge<br />Management <br />Extensible Administration Roles<br />User Interface and PowerShell<br />Browser<br />Client App<br />Consumer<br />Web Part<br />Consumer<br />Web Part<br />WFE SERVER<br />Service Proxy<br />WCF Contract<br />APP<br />SERVER<br />Service Logic<br />SQL<br />SERVER<br />Content<br />Config<br />Custom<br />
    31. 31. SharePoint Service ApplicationsNew Service App Architecture<br />Load Testing<br />Common Infrastructure for “heavy” tasks<br />Web Service & DB provisioning<br />Settings Store<br />Sharing & cross-farm service discovery<br />Service instance discovery within a farm<br />Round-robin load balancer<br />Browser<br />Client App<br />Consumer<br />Web Part<br />Consumer<br />Web Part<br />WFE SERVER<br />Service Proxy<br />WCF Contract<br />APP<br />SERVER<br />Service Logic<br />SQL<br />SERVER<br />Content<br />Config<br />Custom<br />
    32. 32. Ribbon and Dialog Framework<br />Client Site Custom Actions in Ribbon<br />Context Sensitive Ribbon<br />The Ribbon<br />Status Bar<br />Notification Area<br />
    33. 33. Ribbon and Dialog Framework<br />Replaceable SharePoint OOB forms<br />Open as Web Page or as Dialog<br />Dialog Framework<br />
    34. 34. Silverlight and SharePoint 2010New UI Option<br />Media Player Web Part<br />Organization Browser<br />List and Site Creation<br />Office Web Applications<br />Silverlight Web Part<br />Simple way to upload<br />Silverlight CLR compatible <br />Client Object Model<br />Call SharePoint API’s<br />REST APIs<br />Simplifies List data access<br />Support for remotely hosted Silverlight applications<br />Delegated authentication/application principals<br />
    35. 35. SharePoint 2010 for Developers<br />First Class SharePoint Developer Tools<br />Faster Solution Debugging & Tuning<br />Choice of Development Workstation<br />Developer Productivity<br />Comprehensive Data Access<br />Line of Business Integration <br />Workflow Advances<br />Rich Platform Services<br />Application Lifecycle Management <br />Standardized Solution Packaging<br />Deploy with Agility and Stability<br />Flexible Deployment<br />
    36. 36. Sandboxed Solutions<br />Security & Stability<br />Security & Stability<br />BusinessAgility<br />BusinessAgility<br />Essential Agility<br />Essential Stability<br /><ul><li>Easy Deployment
    37. 37. Iterative Development
    38. 38. Access To Shared Servers
    39. 39. SharePoint Online
    40. 40. Safe for Other Users
    41. 41. Limited API Access
    42. 42. Monitored Resources
    43. 43. Separate Process
    44. 44. Site Collection Limits</li></li></ul><li>Sandboxed Solutions<br />
    45. 45. SharePoint Online<br />Upload Sandboxed Solution WSP<br />
    46. 46. Upgrade and PackagingWSP as the SharePoint Installer<br />WSS Solution Package (WSP)<br />Visual Upgrade from version to version<br />SharePoint UI Save To Template<br />Better-defined Upgrade Semantics<br />Declarative upgrade mappings<br />Upgrade callouts for features<br />Application discovery in SharePoint Sites<br />WSPs as unified developer format<br />Works in both site collections and on machine<br />
    47. 47. Team Foundation ServerApplication Lifecycle Management<br />Work Item Tracking<br />Source Code Control<br />Team Build<br />Manage Test Cases<br />Log Bugs<br />Automated Testing<br />Load Testing<br />
    48. 48. Key Takeaways<br />Visual Studio 2010<br />Install on Windows 7<br />SharePoint Designer 2010<br />Developer Dashboard<br />Developer Productivity<br />Business Connectivity Services <br />LINQ, REST and Data Improvements<br />Client Object Model<br />Silverlight Web Part<br />Workflow Improvements<br />Rich Platform Services<br />Team Foundation Server<br />Sandboxed Solutions<br />WSP Solution Upgrade<br />SharePoint Online<br />Flexible Deployment<br />
    49. 49. Best Practices<br />
    50. 50. Testing<br />
    51. 51. Compilation != Testing<br />
    52. 52. Object Disposal<br />
    53. 53. Avoid Tunnel Vision<br />
    54. 54. Document Everything<br />
    55. 55. Call to Action<br />Leverage the OOB features of SharePoint<br />SharePoint Advanced Developer Training on MSDN<br />Get familiar with the SDK<br />Patterns & Practices Guidance on MSDN<br />SharePoint ALM Center on MSDN<br />SharePoint Disposal Patterns on MSDN<br />Use SharePoint Dispose Checker Tool<br />Windows 7 Easy Setup<br />
    56. 56. Questions<br />Time to play “Stump the Presenter!”<br />