You’re Doing It Wrong:A New Developer’s Primer for SharePoint                  – or – Everything that you know is useful, ...
Wake up!
Me:Technical Lead @ Planet TechnologiesDeveloperFatherCommunity OrganizerVirginia Tech HokiePenny Arcade Expo EnforcerUNSC...
Who are you?
SharePoint Development 101• What do you get?• What’s the same?• What tools do I need?• Key dev concepts you need to know• ...
What do you get?• You get a lot of functionality for free   –   Authentication/Authorization   –   Page Templating   –   W...
What’s different?• Website Structure   – Web Application → Site Collection → S.C. Root Web →     Subwebs• Deployment   – C...
What’s the same?• SharePoint is an ASP.Net app  – Web.config  – HTTPHandlers/HTTPModules  – Authentication  – Master Pages...
What tools do I need?• Virtual Machine w/ Visual Studio, SQL Server, Active  Directory, IIS, and MS Office running a serve...
Add-Ins: SharePoint vs. Visual Studio       SharePoint   SharePoint        SharePoint         2007         2010           ...
Key dev concepts you need to know• Memory management (IDisposable)• ASP.Net Web Forms page lifecycle (Page• events) handli...
10 things every developer should know
10 Things Every SharePoint Developer             Should Know10.Whenever possible, avoid creating   custom Site Definitions...
10 Things Every SharePoint Developer             Should Know9. Solution packages are NOT side-by-side,   versioned deploym...
10 Things Every SharePoint Developer             Should Know8. Web.config changes should be made in   code, not by hand  •...
10 Things Every SharePoint Developer             Should Know7. Sandbox limitations are not enforced at   compile time.    ...
10 Things Every SharePoint Developer             Should Know6. Out of the box master & layout pages   should never be modi...
10 Things Every SharePoint Developer             Should Know5. JavaScript and Publishing Content Pages   do not play well ...
10 Things Every SharePoint Developer             Should Know4. Yes, you can have ASP.Net “yellow   screen of death” callst...
10 Things Every SharePoint Developer             Should Know3. There is a right and very wrong way to   iterate through a ...
10 Things Every SharePoint Developer             Should Know2. Many of the out-of-box web part classes   are inheritable (...
10 Things Every SharePoint Developer             Should Know1. The rules for proper disposal of   SharePoint objects isn’t...
How to get your code rejected by your      SharePoint Architecture Group• Don’t dispose of your SPSite and SPWeb  (and rel...
Resources• SPDisposeCheck Utility  – http://code.msdn.microsoft.com/SPDisposeCheck• StackOverflow/SharePointOverflow  – ht...
Demo!
Questions?
One more thing…
Right now: Downstairs, in the lunch place…         Delicious Cake (really).
Thanks for coming!• Don’t forget your evaluations• You can find me at:   • Blog: http://greghurlman.com   • Twitter: @ghur...
Photo Credits•   http://www.flickr.com/photos/matthewebel/4542976737/•   http://www.flickr.com/photos/photojonny/226884590...
SharePoint Development 101
Upcoming SlideShare
Loading in...5
×

SharePoint Development 101

4,699

Published on

Published in: Technology
1 Comment
2 Likes
Statistics
Notes
No Downloads
Views
Total Views
4,699
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
107
Comments
1
Likes
2
Embeds 0
No embeds

No notes for slide

Transcript of "SharePoint Development 101"

  1. 1. You’re Doing It Wrong:A New Developer’s Primer for SharePoint – or – Everything that you know is useful, but is still, somehow, very, very wrong. #spdev101
  2. 2. Wake up!
  3. 3. Me:Technical Lead @ Planet TechnologiesDeveloperFatherCommunity OrganizerVirginia Tech HokiePenny Arcade Expo EnforcerUNSC M12 FAV “Warthog” gunnerWorld Famous Jungle Cruise Skipper (ret.) #spdev101
  4. 4. Who are you?
  5. 5. SharePoint Development 101• What do you get?• What’s the same?• What tools do I need?• Key dev concepts you need to know• 10 things every SharePoint developer should know• How to get your code rejected by your SharePoint Architect(s)• Resources #spdev101
  6. 6. What do you get?• You get a lot of functionality for free – Authentication/Authorization – Page Templating – Workflow hosting/reporting – Data storage• You get a LOT of functionality for free – Federated Search – Metadata management – Excel Data Services – Access Services – – Business Connectivity Services Scalable Service Hosting – Single Sign-On – Visio Workflow integration – Etc. – Etc. #spdev101
  7. 7. What’s different?• Website Structure – Web Application → Site Collection → S.C. Root Web → Subwebs• Deployment – Code → Assembly → Feature (usually) → Package (.WSP)• Fea⋅ture /ˈfit ər/ -noun ʃ 1. A functional unit of SharePoint functionality, scoped at a Farm, Web Application, Site Collection, or Web level• Packages – First added to the server farm – Then, deployed to individual web applications (or globally) #spdev101
  8. 8. What’s the same?• SharePoint is an ASP.Net app – Web.config – HTTPHandlers/HTTPModules – Authentication – Master Pages – Web Parts == Composite Server Controls • Inherit from System.Web.UI.WebControls.WebParts.WebPart – Postbacks/Event Lifecycle Model #spdev101
  9. 9. What tools do I need?• Virtual Machine w/ Visual Studio, SQL Server, Active Directory, IIS, and MS Office running a server OS (64-bit for SP 2010)• Microsoft SharePoint 2010 SDK – Documentation – Code samples• SharePoint Visual Studio add-ins Windows SharePoint Services 3.0 Tools: Visual Studio 2008 Extensions, Version 1.2 (VSeWSS)  WSPBuilder (for VS 2008/SP 2007 or VS/SP 2010)  Visual Studio 2010 Tools for SharePoint Development (SP 2010 Only)  Microsoft Office Developer Tools for Visual Studio 2012 - Preview 2 (SP 2013 only, SP 2010 is OOB) #spdev101
  10. 10. Add-Ins: SharePoint vs. Visual Studio SharePoint SharePoint SharePoint 2007 2010 2013 WSPBuilder WSPBuilder NOPE :(2008VS Visual Studio 2010 Tools for2010 WSPBuilder NOPE :( SharePointVS Development Microsoft Office Developer Tools2012 NOPE :( Built-in :D for Visual StudioVS 2012 - Preview 2 #spdev101
  11. 11. Key dev concepts you need to know• Memory management (IDisposable)• ASP.Net Web Forms page lifecycle (Page• events) handling & process flow Exception• (try/catch/finally) not just thru server controls) HTML & CSS (raw,• JavaScript (SharePoint Client-Side Object• Model) JavaScript (jQuery)• JavaScript (KnockoutJS, Modernizr, etc)• Regular Expressions (because SCIENCE)
  12. 12. 10 things every developer should know
  13. 13. 10 Things Every SharePoint Developer Should Know10.Whenever possible, avoid creating custom Site Definitions • Use Web Templates #spdev101
  14. 14. 10 Things Every SharePoint Developer Should Know9. Solution packages are NOT side-by-side, versioned deployments #spdev101
  15. 15. 10 Things Every SharePoint Developer Should Know8. Web.config changes should be made in code, not by hand • SPWebConfigModification #spdev101
  16. 16. 10 Things Every SharePoint Developer Should Know7. Sandbox limitations are not enforced at compile time. You need: • Visual Studio 2010 SharePoint Power Tools • Office365 Sandbox FxCop Rules #spdev101
  17. 17. 10 Things Every SharePoint Developer Should Know6. Out of the box master & layout pages should never be modified #spdev101
  18. 18. 10 Things Every SharePoint Developer Should Know5. JavaScript and Publishing Content Pages do not play well together OK (In a Content Editor Web Part): <script type=“text/javascript">…</script> Not OK (CEWP or page content): <a href="#" onclick="javascript: …">link</a> List data is always stripped of JavaScript #spdev101
  19. 19. 10 Things Every SharePoint Developer Should Know4. Yes, you can have ASP.Net “yellow screen of death” callstacks on errors In your web.config file: 1. Set mode to “off” in the customErrors element 2. Set debug to “true” in the compilation element 3. Set CallStack to “true” in the SafeMode element In code! • SPWebConfigModification #spdev101
  20. 20. 10 Things Every SharePoint Developer Should Know3. There is a right and very wrong way to iterate through a SharePoint list OK: SPListItemsCollection items = myList.Items; for (int i = 0; i < items.Count; i++) { // loop } Not OK: foreach (SPListItem item in myList.Items) { // loop } #spdev101
  21. 21. 10 Things Every SharePoint Developer Should Know2. Many of the out-of-box web part classes are inheritable (but not all) You need: ILSpy #spdev101
  22. 22. 10 Things Every SharePoint Developer Should Know1. The rules for proper disposal of SharePoint objects isn’t cut & dry – but there is help. SPDisposeChe (Write ck down) this #spdev101
  23. 23. How to get your code rejected by your SharePoint Architecture Group• Don’t dispose of your SPSite and SPWeb (and related) objects properly – The SPDisposeCheck utility is invaluable for this• Use SPSecurity.RunWithElevatedPrivileges when unnecessary or just plain badly• Log errors to whatever’s handy at the time• Make changes to the web.config file without consideration for others #spdev101
  24. 24. Resources• SPDisposeCheck Utility – http://code.msdn.microsoft.com/SPDisposeCheck• StackOverflow/SharePointOverflow – http://stackoverflow.com – http://sharepointoverflow.com• Twitter (#SPHelp)• Your local SharePoint User Group #spdev101
  25. 25. Demo!
  26. 26. Questions?
  27. 27. One more thing…
  28. 28. Right now: Downstairs, in the lunch place… Delicious Cake (really).
  29. 29. Thanks for coming!• Don’t forget your evaluations• You can find me at: • Blog: http://greghurlman.com • Twitter: @ghurlman • Email: greg@greghurlman.com • Princeton Area SharePoint User Group • SharePoint Saturday New York & New Jersey • Manticore Theatre @ PAX East #spdev101
  30. 30. Photo Credits• http://www.flickr.com/photos/matthewebel/4542976737/• http://www.flickr.com/photos/photojonny/2268845904/• http://www.flickr.com/photos/damaradeaella/2822846819/• http://www.flickr.com/photos/yourdon/3890013824/• http://www.flickr.com/photos/tommarker/474596167/ #spdev101
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×