1 / 26

Microsoft Patterns and Practices SharePoint Guidance

Microsoft Patterns and Practices SharePoint Guidance. Robert L. Bogue MS MVP, MCSE, MCSA: Security Rob.Bogue@ThorProjects.com. Where are we today?. Where are we today (for real)?. There are relatively few SharePoint Developers today

lyndon
Download Presentation

Microsoft Patterns and Practices SharePoint Guidance

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Microsoft Patterns and PracticesSharePoint Guidance Robert L. BogueMS MVP, MCSE, MCSA: Security Rob.Bogue@ThorProjects.com

  2. Where are we today?

  3. Where are we today (for real)? • There are relatively few SharePoint Developers today • We have free training that MS provides at http://mssharepointdeveloper.com • Hands on labs • Presentations • Demos (code) • … but we don’t have best practices

  4. Who are the Patterns and Practices Group at Microsoft?

  5. The Scenario – Training Management • Corporate Training is a big deal. • It needs tracked for personnel reasons • Budgeted for accounting reasons

  6. How do we Deploy Solutions? SharePoint Solution (WSP) WSPs are to SharePoint like MSIs are to Windows WSPs deploy correctly across the farm WSPs deliver assemblies, pages, and features

  7. When should I create a Site Definition? When you need to distinguish a site for future changes When you start so you can differentiate between your sites and OOB sites See: How to Use Site Definitions in SharePoint

  8. How should I make a Site Definition? Make it an empty shell Create all of the functionality for the Site Definition as features Use Dependencies to have the features activated when the site is created See: SharePoint 2007 Web Content Management Development

  9. How do I make changes to a Site Definition? Design additional Features Feature staple the feature to the site definition

  10. What is Stapling? Allows you to specify a feature that must be activated when a site is created with a definition – without changing the definition What it doesn’t do … activate a feature on existing sites so… Write a feature receiver to activate on the existing sites.

  11. When to use Site Templates? When you want to allow users to make changes to the predefined content User interface can create them (no development tools required) Can be globally deployed via STSADM command

  12. Lists Definition vs. Content Types • List Definition • Specify fields • Specify forms • Specify views • Content Types • Specify fields • Specify forms

  13. What do we do about branding? • Themes • Use Include • Master Pages • For core controls that must be on every page • Web Part Page • Layout of controls (web part zones) • Page Layouts (MOSS Only) • How the pages lay out content

  14. Where do you store configuration? • Web.Config? • How do you manage across servers? SharePoint API • What do you do when the SharePoint Web.Config modification API is flaky? • SPPropertyBag is on ALL SPPersistedObjects (SPFarm, SPWeb, etc.)

  15. Creating Content Types Every Content type gets a unique ID The Unique ID has GUIDs in it… Creating Content Types from the UI causes unique GUID Creating from the API creates new GUIDs

  16. Modifying Content Types The product team says… don’t overlay the file, use code to programmatically change I say… update your Content Type XML and use a feature receiver to propagate

  17. Managing Process: Event Receiver vs. Workflow

  18. SPList vs. Database Table • SPList • User controllable fields • User controllable views • Export to Excel • Alerts • Database • High performance • Large scalability

  19. Custom ASPX pages Need to Inherit from a class (think ASP.NET 1.1) Need to have 5 part name (class + 4 part assembly) for the class to inherit

  20. RenderContents vs. CreateChildControls • Render/RenderContents = BAD • ASP approach • No events • No multi-device support • CreateChildControls • ASP.NET Approach • PostBack, ViewState, etc. • Multi-device support

  21. How do I manage Dev-Test-Prod? Code moves from DEV to TEST to PROD Content moves from PROD to TEST (and rarely to DEV) See: Managing the Code when Customizing SharePoint

  22. Updating Assemblies • The assemblies are often loaded by four part name… • Name • Version • Culture • Public Key Token • The four part name is in the content DB (which you can’t modify directly)

  23. Unit Testing It’s hard Objects are sealed and have internal constructors TypeMock can be used… You can isolate your SharePoint calls

  24. Continuous Integration How do you setup a build server? (Build requires SharePoint installed) How do you dynamically create SharePoint Solutions Packages

  25. What if I want more? Go to http://www.codeplex.com/spg

  26. Thank You Robert L. BogueRob.Bogue@ThorProjects.com

More Related